i18n Support #160

Merged
MaxiBoether merged 68 commits from i18n into master 2017-06-05 17:34:23 +02:00
MaxiBoether commented 2017-05-30 15:04:09 +02:00 (Migrated from github.com)

Please excuse some double commits, but it seems like a rebase did go wrong. We doublechecked to make sure every String is translateable, please tell us if we missed a String. There is also a sample translation added that just adds RS_ to every string. Users are able to change the language in the options.
I will also try and create a German translation as soon as this is merged into master. intnick will probably make a Serbian translation.

Please excuse some double commits, but it seems like a rebase did go wrong. We doublechecked to make sure every String is translateable, please tell us if we missed a String. There is also a sample translation added that just adds RS_ to every string. Users are able to change the language in the options. I will also try and create a German translation as soon as this is merged into master. intnick will probably make a Serbian translation.
kauffj (Migrated from github.com) reviewed 2017-05-31 02:01:19 +02:00
kauffj (Migrated from github.com) commented 2017-05-31 02:01:19 +02:00

Tick marks are only used around interpolated strings. If interpolation is being dropped, please switch to double quotes.

Tick marks are only used around interpolated strings. If interpolation is being dropped, please switch to double quotes.
kauffj (Migrated from github.com) reviewed 2017-05-31 02:02:38 +02:00
@ -38,35 +38,28 @@ export const selectPageTitle = createSelector(
selectCurrentParams,
kauffj (Migrated from github.com) commented 2017-05-31 02:02:38 +02:00

This code was correct. Yes, it means it cannot easily be translated. For tricky ones like this, just make a note and we'll figure out how to resolve them.

This code was correct. Yes, it means it cannot easily be translated. For tricky ones like this, just make a note and we'll figure out how to resolve them.
kauffj (Migrated from github.com) reviewed 2017-05-31 02:05:49 +02:00
kauffj (Migrated from github.com) commented 2017-05-31 02:05:49 +02:00

Please update the README and add a heading titled "Internationalization" that explains a bit about this, and anything else that would be relevant to set up or programmers new to the repo. Should be a couple paragraphs tops, and possibly just a sentence or two.

Please update the README and add a heading titled "Internationalization" that explains a bit about this, and anything else that would be relevant to set up or programmers new to the repo. Should be a couple paragraphs tops, and possibly just a sentence or two.
kauffj (Migrated from github.com) reviewed 2017-05-31 02:06:52 +02:00
kauffj (Migrated from github.com) commented 2017-05-31 02:06:52 +02:00

Misstructured call?

Misstructured call?
kauffj (Migrated from github.com) reviewed 2017-05-31 02:07:59 +02:00
kauffj (Migrated from github.com) commented 2017-05-31 02:07:59 +02:00

Is this used? If not, no need to global.

Is this used? If not, no need to global.
kauffj (Migrated from github.com) reviewed 2017-05-31 02:08:34 +02:00
kauffj (Migrated from github.com) commented 2017-05-31 02:08:34 +02:00

This can probably be imported when needed, rather than globalled.

This can probably be imported when needed, rather than globalled.
kauffj (Migrated from github.com) reviewed 2017-05-31 02:10:13 +02:00
kauffj (Migrated from github.com) left a comment

Nothing too major, but a few changes I'd like. Next big piece will be figuring out how to pipe translations in and out.

Nothing too major, but a few changes I'd like. Next big piece will be figuring out how to pipe translations in and out.
kauffj commented 2017-05-31 02:10:47 +02:00 (Migrated from github.com)

@lyoshenka might want to take a look at this one too

@lyoshenka might want to take a look at this one too
MaxiBoether (Migrated from github.com) reviewed 2017-05-31 12:31:00 +02:00
@ -38,35 +38,28 @@ export const selectPageTitle = createSelector(
selectCurrentParams,
MaxiBoether (Migrated from github.com) commented 2017-05-31 12:31:00 +02:00

@intnick I think you translated this, could you please take a look?

@intnick I think you translated this, could you please take a look?
MaxiBoether (Migrated from github.com) reviewed 2017-05-31 12:31:41 +02:00
MaxiBoether (Migrated from github.com) commented 2017-05-31 12:31:41 +02:00

Ohhh, this were my Windows compilation files. They were not supposed to be made public because most ppl are probably working with unix based systems. I am gonna remove them

Ohhh, this were my Windows compilation files. They were not supposed to be made public because most ppl are probably working with unix based systems. I am gonna remove them
MaxiBoether (Migrated from github.com) reviewed 2017-05-31 12:33:10 +02:00
MaxiBoether (Migrated from github.com) commented 2017-05-31 12:33:10 +02:00

@intnick can you please have a look at those?

@intnick can you please have a look at those?
MaxiBoether (Migrated from github.com) reviewed 2017-05-31 12:38:44 +02:00
MaxiBoether (Migrated from github.com) commented 2017-05-31 12:38:44 +02:00

should be fixed

should be fixed
MaxiBoether (Migrated from github.com) reviewed 2017-05-31 12:39:24 +02:00
MaxiBoether (Migrated from github.com) commented 2017-05-31 12:39:24 +02:00

should be fixed

should be fixed
intnick (Migrated from github.com) reviewed 2017-06-01 15:31:52 +02:00
@ -38,35 +38,28 @@ export const selectPageTitle = createSelector(
selectCurrentParams,
intnick (Migrated from github.com) commented 2017-06-01 15:31:52 +02:00

OK, do you want to return to the initial solution ? We could possibly translate the return of the function, I just found it not to be an elegant or easily readable solution so I separated them

OK, do you want to return to the initial solution ? We could possibly translate the return of the function, I just found it not to be an elegant or easily readable solution so I separated them
intnick (Migrated from github.com) reviewed 2017-06-01 15:37:50 +02:00
intnick (Migrated from github.com) commented 2017-06-01 15:37:49 +02:00

Yes, the translate functions are used on every page. __n is used rarely and we could use it as i18.__n() instead, though to make it equivalent and available.
I tried it first with i18n component in local scope but problems start with language switching. It wouldn't change the language strings if on the settings page we load the i18n again and do a setLanguage(language) method call. We could tell the user to restart the app, which would have been much easier for me, but I didn't like the idea of app restart if you changed the language. More than open for other suggestions ?

Yes, the translate functions are used on every page. __n is used rarely and we could use it as i18.__n() instead, though to make it equivalent and available. I tried it first with i18n component in local scope but problems start with language switching. It wouldn't change the language strings if on the settings page we load the i18n again and do a setLanguage(language) method call. We could tell the user to restart the app, which would have been much easier for me, but I didn't like the idea of app restart if you changed the language. More than open for other suggestions ?
kauffj (Migrated from github.com) reviewed 2017-06-01 15:53:13 +02:00
@ -38,35 +38,28 @@ export const selectPageTitle = createSelector(
selectCurrentParams,
kauffj (Migrated from github.com) commented 2017-06-01 15:53:13 +02:00

Yes, just leave it the way that it was. I'm fine if a few problem strings aren't translated to start (though it'd be good to build a list of these).

Yes, just leave it the way that it was. I'm fine if a few problem strings aren't translated to start (though it'd be good to build a list of these).
kauffj (Migrated from github.com) reviewed 2017-06-01 15:55:57 +02:00
kauffj (Migrated from github.com) commented 2017-06-01 15:55:57 +02:00

I think it'd make sense for i18n to be set in ui/js/app.js then?

I think it'd make sense for i18n to be set in `ui/js/app.js` then?
kauffj commented 2017-06-01 15:56:45 +02:00 (Migrated from github.com)

Please make sure to ping me once the few remaining minor changes are made -- I'll put this in master than so we stop generating conflicts with ongoing work.

Please make sure to ping me once the few remaining minor changes are made -- I'll put this in master than so we stop generating conflicts with ongoing work.
intnick (Migrated from github.com) reviewed 2017-06-01 16:10:29 +02:00
@ -38,35 +38,28 @@ export const selectPageTitle = createSelector(
selectCurrentParams,
intnick (Migrated from github.com) commented 2017-06-01 16:10:29 +02:00

On it. I think a few more have the same case and name so I'll aggregate those as well.

On it. I think a few more have the same case and name so I'll aggregate those as well.
intnick (Migrated from github.com) reviewed 2017-06-01 16:11:08 +02:00
intnick (Migrated from github.com) commented 2017-06-01 16:11:08 +02:00

Trying it out

Trying it out
MaxiBoether (Migrated from github.com) reviewed 2017-06-01 17:07:35 +02:00
@ -38,35 +38,28 @@ export const selectPageTitle = createSelector(
selectCurrentParams,
MaxiBoether (Migrated from github.com) commented 2017-06-01 17:07:35 +02:00

I don't know if it helps, but wrapping __() around the output, even if it's not a build-in String (e.g. rewards which are loaded from the server) also work with y18n, you just need to run the app once and then it's added to the language file automatically

I don't know if it helps, but wrapping __() around the output, even if it's not a build-in String (e.g. rewards which are loaded from the server) also work with y18n, you just need to run the app once and then it's added to the language file automatically
kauffj commented 2017-06-02 21:52:51 +02:00 (Migrated from github.com)

Please make the changes discussed in Slack.

Please make the changes discussed in Slack.
MaxiBoether commented 2017-06-03 13:35:33 +02:00 (Migrated from github.com)

Changes should be made, but please review carefully

Changes should be made, but please review carefully
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: LBRYCommunity/lbry-desktop#160
No description provided.