-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Salvador Villalon] Add i18n settings translation #44
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One blocking request which needs to be addressed before we can merge this.
i18n/locales/en_us.json
Outdated
"saveSettingDescriptorSaveToGallerySaveLocally": "Save to your gallery, save locally", | ||
"saveSettingDescriptorExportAsFile": "export as a file", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't want to do this because it make translation very difficult. English sentence structure doesn't match all other languages, so translating this will be very awkward. Instead, we should change piskel to remove the <br>
from the middle of the sentences and let the text flow normally in the HTML. If this results in a div/box which is too wide, then we should be setting the CSS property width
to limit the size.
Please rework the strings and templates which have <br/>
tags in them. Also, check if I missed this in any previous pull requests as well.
Co-authored-by: Dayne <dayne@code.org>
…de-dot-org/piskel into add-i18n-settings-translation Getting new code from pr suggestion
Overview
This change adds translation strings for the settings options.
We use the function fillIntTemplate found in utils/Template.js to help us generate templates with values in them
New templates in misc-templates.html have been added.
settings.html now does not have any static content. Instead, it has comments saying where the context gets created from.
To Note
When I was trying to fill up the templateValues Object. It was not accepting template literals. When I tried doing them, the application will not run. Instead, I went back to doing string concatenation and this worked. I believe it has something to do with the version of js since it did not accept new standards like let or const
Testing Done
In the picture, you can see that the Settings Option now has the TEST N in each text. Highlighted in red. This comes from en_us.json which means that the translation did go through.
We also see that we successfully generated the HTML content and we longer need to write HTML in settings.html
Follow Up
Going to work on Color Palette Tool