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
js intl #1127
js intl #1127
Conversation
c02bd83
to
a017e89
Compare
PR #1051 is now merged. |
58086b6
to
fae17a5
Compare
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.
Good progress. Just making a comment about the decision to go with a map entry in the locales package.
Also you'll want to check in the changes to localized_html/en-US/bodybuilder.tmpl
Can we split off the pt-BR work some time before merging? |
Also pls squash it down (except with the pt-BR translations separate) before hitting ready for review. I've been testing a little here and there and it's mostly working, except the things we've already chatted about in matrix: a number of notifications in core.go still need to go through |
8a11eb1
to
b8cd1ef
Compare
4164320
to
a2838f9
Compare
export const ID_NO_PASS_ERROR_MSG = 'ID_NO_PASS_ERROR_MSG' | ||
export const ID_NO_APP_PASS_ERROR_MSG = 'ID_NO_APP_PASS_ERROR_MSG' | ||
export const ID_SET_BUTTON_BUY = 'ID_SET_BUTTON_BUY' | ||
export const ID_SET_BUTTON_SELL = 'ID_SET_BUTTON_SELL' | ||
export const ID_OFF = 'ID_OFF' |
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.
This all seems peculiar to me. Seems like these consts should just be an enumeration or something with integers. Is this really what JavaScript forces us to do? The actual strings here are meaningless, just intended to be unique.
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.
Can leave this if it's Decrediton's approach, unless you or someone else has a better suggestion.
Add missing Language into core
17cd000
to
71c9841
Compare
71ce804
to
86d8acd
Compare
@@ -165,4 +165,6 @@ var EnUS = map[string]string{ | |||
"Restoration Seed": "Restoration Seed", | |||
"Restore from seed": "Restore from seed", | |||
"Import Account": "Import Account", | |||
"no_wallet": "no wallet", | |||
"create_a_x_wallet": "Create a {{.Info.Name}} Wallet", // .Info.Name will be an asset symbol like DCR |
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.
To document the reasoning for this, in portuguese we use a different sentence structure from english, saying "criar uma carteira decred" like it was: "create a wallet decred". So doing <button data-action="create">[[[Create a]]] {{.Info.Name}} [[[Wallet]]]</button>
created a challenge.
My suggestion was simply to use go html template xpressions in the locale strings and let them find their way in to the localized_html files, which they do. e.g. in pt-BR, <button data-action="create">Criar uma carteira {{.Info.Name}}</button>
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.
Also we can now get rid of the "Create a"
map entry, correct? EDIT: resolved.
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.
Working well. We can discuss tweaks to the translation machinery in #1185, which will follow this.
This PR is a work torward the internationalization.
It is a collective work with #1051 and I am focusing on the js internationalization here.