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

i18n: Add custom translation file and doc #3569

Merged
merged 2 commits into from
Oct 20, 2021

Conversation

matheusd
Copy link
Member

@matheusd matheusd commented Oct 13, 2021

This allows loading custom translation files for the main UI (.json) and adds a doc explaining the translation process for communitity members.

A development build with the ability to import the custom translation files is available below. Preview the doc for community translators.

Warning: Ideally only use those binaries on a VM to ensure it doesn't mess around on your existing install.

https://github.com/matheusd/decred-weekly-builds/releases/tag/v20211013150209

This allows loading custom translation files for the main UI (.json) and adds
a doc explaining the translation process for communitity members.
Copy link
Contributor

@xaur xaur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great to see this! Just a few nits for community_translations.md (not commenting on other files).

app/i18n/community_translators.md Outdated Show resolved Hide resolved
app/i18n/community_translators.md Outdated Show resolved Hide resolved
app/i18n/community_translators.md Outdated Show resolved Hide resolved

Load the following files, all located in the checked out copy of the repository, in the `app/i18n/translations` subdir:

- `previous_original.json` (this file contains the original strings of the _previous_ Decrediton version)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not clear from this doc how this file is involved. But I haven't checked translator.html, perhaps it is explained there. If so, ignore this comment.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's used to determine source strings that changed between releases (hypothetical example, app.title changed from Decrediton to Here's Decrediton).

There aren't really "explanations" in the translator file (it's pretty rough for the moment) but it shouldn't really matter as long as the translator loads the file.

@alexlyp alexlyp merged commit dc00928 into decred:master Oct 20, 2021
@xaur
Copy link
Contributor

xaur commented Oct 20, 2021

@matheusd which commit does previous_original.json come from? I thought it would be from the v1.6.3 release but original.json from there has more strings.

@xaur xaur mentioned this pull request Oct 20, 2021
@matheusd matheusd deleted the community-i18n branch October 22, 2021 12:18
@matheusd
Copy link
Member Author

On this PR it came from (IIRC) 1.5.0. previous_original is meant to be the original from the previous version of the software, such that the translator UI can figure out strings which changed across versions and present those for review.

For example, if the string foo.bar changed from ... and you're supposed to click this button... to and you're supposed to *NOT* click this button... I wanna be able to give translators notice that they need to review this change when upgrading from the previous version to the new version.

@xaur
Copy link
Contributor

xaur commented Oct 23, 2021

Yeah it's great to have this diffing for context.

I just wondered shouldn't translators compare strings in master against v1.6.3 (i.e. have previous_original.json checked out from there)? Or was v1.5.0 the last release with major update to translations that they should be comparing against?

@matheusd
Copy link
Member Author

To avoid churning, the previous_original.json and original.json files are updated once we're close enough to a release that we don't expect many new strings to popup.

We still have a couple of major PRs to go in (the ones related to DEX), so that's why they're still referring to the old version.

Once those DEX PRs are in, I'll send a PR that updates original.json to the strings expected for the new release (i.e. 1.7.0) and the previous_original.json to the ones for 1.6.3.

In other words, original.json is what's going to go on the next release and previous_original.json what was on the last release.

This is still largely a hold over from the old translation flow, where it didn't make sense to always keep original.json in sync to the source code. We can evaluate whether it's useful to have some way of always regenerating original.json on every PR merged to decrediton or some other way of generating these files externally (e.g. through my weekly build system).

@xaur xaur mentioned this pull request Nov 4, 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.

3 participants