[NPMCLI-91] Move CLI "texts" into a common resource bundle file (i18n) Created: 31/Jan/17  Updated: 16/Mar/17  Resolved: 10/Mar/17

Status: Closed
Project: Magnolia CLI
Component/s: None
Affects Version/s: None
Fix Version/s: 2.1.0

Type: Improvement Priority: Neutral
Reporter: Christoph Meier Assignee: Robert Kowalski
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Date of First Response:
Sprint: Basel 86
Story Points: 5

 Description   

Issue

At the moment, all texts addressed to CLI users are widespread among command-js-files.
I propose to move these texts into one resource bundle file (most probably a json file).

Motivation

docs maintenance

tbh - my first motivation was rather selfish and documentation centric. With such a common resource bundle file - i could read it and use with a Confluence macro. This would in the long run reduce the amount of work of maintenance of the (CLI) documentation.

18n

I do not expect that we will create translations for other languages in the near future - however - it doesn't hurt to make it 18n ready now - but it may hurt in future.

Ease of linguistic review

During the NOW development we have seen that it is impossible for a linguist to make a UI text review, if the texts are hardcoded and widespread among code files. But to have the texts in one single (json) file makes it very easy for a non developer to review the text and to polish them. (Guys as Martin or Julie could do such a text review.)

etc.

I already had a quick SKYPE call with robertkowalski whether this is feasible and common practice in the CLI / NPM world too - which he confirmed.
Robert also has mentioned, that at the moment many files are touched anyway. So - i18n-ization could be done additionally while fixing / improving other things. (Just make sure to have separate commits.)

Keys

If the ticket will be tackled - we would have to find a suitable naming convention for good keys.
I could propose here some ideas - if desired - since i already was thinking about a bit.
However - other guys have a lot of experience in this topic too.
Basically i would expect something like
$commandName.$topic, e.g. create-page.sucess-next-step-tip



 Comments   
Comment by Robert Kowalski [ 06/Mar/17 ]

Started to explore the topic in https://git.magnolia-cms.com/projects/BUILD/repos/npm-cli/compare/diff?targetBranch=refs%2Fheads%2Fmaster&sourceBranch=refs%2Fheads%2Ffeature%2FNPMCLI-91--i18n&targetRepoId=1201

one thing I noticed is that its hard to read the error messages without taking a look at the separate file with a key based approach.

fgrilli ilgun creichenbach what do you think regarding maintanance / development?

Generated at Mon Feb 12 04:46:26 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.