Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Translations! #934

Merged
merged 45 commits into from
May 26, 2017
Merged

Translations! #934

merged 45 commits into from
May 26, 2017

Conversation

dbkr
Copy link
Member

@dbkr dbkr commented May 26, 2017

dbkr and others added 30 commits May 23, 2017 15:16
Move translation status to its own heading
 * Read languages from the available ones rather than the config
 * Make the search work (add searchEnabled=true)
 * Move variables to the class since they were populated there
Add a label. Make css selector match style. Also fix import.
We no longer need the custom counterpart. The things that were
changed in it and reasosn we no lomger need them are:

 1. set separator - this can be done with standard counterpart
 2. ES6 port: this was done to allow importing as _t, but is
    unnecessary with the _t wrapper function in react-sdk
    (although also seems to work fine with
    `import _t from 'counterpart';`)
 3. Fallback to key name: unnecessary with
    `setMissingEntryGenerator` in 0.18, but we've changed to just
    using a fallback locale anyway since No code missing en
    translations should ever make it to the devbelop branch.
 4. Logging on missing translations. Unnecessary with
    `onTranslationNotFound`, but now not used anyway because we
    let missing translations show up in the UI as
    'missing translation'

Bulk changes to imports coming in separate commit for easy reading.
to use languageHandler wrapper func
As I've now added code to this file
We already do it in the place this function gets called
 * Replace callbacks with promises
 * Move plain functions to top level
 * De-duplicate bits that fetched languages.json
 * Take full language preference list from the browser if we
   can get it, rather than just the first.
Actually translate the language dropdown label & add the string.
Remove some unused ones.
But make them work by calling _t in render rather than
getDefaultProps().

Also sort out some 'Warning!' strings
Make it reflect reality if it's been taken from the browser langs
by just getting what was saet in counterpart rather than the saved
setting.

Also fix style.
dbkr added 4 commits May 25, 2017 20:04
The translations strings are not HTML and it gets escaped.
 * Serve translation files from the karma server
 * Port UserSettingsStore to ES6 exports because the test runner
   gets confused by ES6 importing a commonjs module
 * Remove extra spaces in translations strings for MELS
 * Fix 'his/her' back to be 'their'
 * Change test to expect singular 'invitation' for a single person
   (there may be multiple invitations, but IMO this should be
   'rejected n invitations' and we can play with the wording later,
   I don't think the singular is any worse than the plural).
 * set language in the MELS tests (and wait for it to complete)
 * Don't bother setting lang in other tests for now
@ara4n
Copy link
Member

ara4n commented May 26, 2017

haven't gone through every line but have read through languageHandler which seems fine. and i trust that the rest is okay, given it's been reviewed one way or another about 3 times now. lgtm!

@dbkr dbkr mentioned this pull request May 26, 2017
12 tasks
@dbkr dbkr merged commit f4184bc into develop May 26, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants