A localization JSON standard is required. #880
Labels
No labels
_CRITICAL_
API
app
backEnd
Blocked, waiting for further changes
bug
cleanup
close
design
duplicate
enhancement
feature request
frontEnd
help wanted
invalid
low priority
needs input
needs review
project documentation
question
research
reviewed
script
security
SQL
style
testing
topLevel
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Andras/BoundlessFlowCampus2K#880
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
In my work with coming to grips with issue #861, i have come to the realization that we at present have no standard for localization keys, which I think is vitally important to have since all non-user text will rely on them to print text.
In particular is the problem that JSON files by their very nature do not support comments, also the language/translation system we are using requires a flat JSON, which means no nested hiearchy. These issues makes grouping very difficult and risks becoming an unreadable mess.
I would personally suggest the use of namespaced keys, with the page/component as the root namespace and additional namespaces for subsections where suitable. And I would suggest using linebreaks to group pages/component keys.
Here's an example of what the localization keys for the settings page would looke like.
Before I proceed any further on #861 i would like this matter sorted. Thank you!
Good insight! as this is the first real implementation of our localization we are a bit behind on the documentation.
We believe your suggestion is a good way to go about it.
We could remake it to have a locale file for each view/component but as most of our views have very little printed text it felt like it would just bloat the code.
Start using the suggested method of using namespace with line brakes to make the code more readable,
we will create issues to update the wiki for how to implement the localization along with adding it to the review template. But i think you can start with the implementation, that way if you find any problems or changes we need to do we can have that in mind when creating the wiki for implementing it in the future.
Does that sound good to you @f21marfo?
@c24danli Sounds good! I shall press on with the work.
Also just to add, for reference, i realized a separate "UI" category/namespace would probably be good to have, for non-unique strings like: Edit, Change, Update, Delete, etc. Kind of pointless to translate them multiple times.
Like:
@f21marfo wrote in #880 (comment):
Yes for common things can it be a good idea to have this to reduce duplicate code. But if some views happens to have the same text then i would say it probably better to separate it just to have the flexibility to change just one.
@c24danli Oh definitely, that was more focused on unformatted monosyllabic strings, which are extremely unikely to change and remain consistent, regardless of context.
This is added to the wiki so i will close this issue