Skip to content
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

Merged
merged 8 commits into from
May 24, 2021

Conversation

salvillalon45
Copy link

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

image (9)
image (8)

Follow Up

Going to work on Color Palette Tool

@salvillalon45 salvillalon45 requested a review from daynew May 20, 2021 21:42
Copy link
Member

@daynew daynew left a 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 Show resolved Hide resolved
Comment on lines 57 to 58
"saveSettingDescriptorSaveToGallerySaveLocally": "Save to your gallery, save locally",
"saveSettingDescriptorExportAsFile": "export as a file",
Copy link
Member

@daynew daynew May 21, 2021

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.

salvillalon45 and others added 3 commits May 24, 2021 10:17
Co-authored-by: Dayne <dayne@code.org>
…de-dot-org/piskel into add-i18n-settings-translation

Getting new code from pr suggestion
@salvillalon45 salvillalon45 requested a review from daynew May 24, 2021 20:49
@salvillalon45 salvillalon45 merged commit 961e60f into add-i18n May 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants