Commit graph

74 commits

Author SHA1 Message Date
Kegsay
0b56d33bd2 Null guard all interpolated strings passed to _t (#1035) 2017-06-06 13:56:37 +01:00
Michael Telatynski
464863acd6 remove unused imports
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2017-06-02 21:35:55 +01:00
Marcel
8c2728ffc5 Revert changes of the key used 2017-06-01 21:10:58 +02:00
Marcel
924a8d1be0 Fix line change that should not happen 2017-06-01 21:03:43 +02:00
Marcel
51131ef7a5 Fix translation tests part 2 2017-06-01 21:02:40 +02:00
Marcel
cbf967a86d Fix tests
We do not have a en.json but a en_EN.json
2017-06-01 20:53:59 +02:00
Matthew Hodgson
8e34b59d32 Revert "Revert "add labels to language picker"" 2017-06-01 19:46:25 +01:00
Richard van der Hoff
b3e9716126 Revert "add labels to language picker" 2017-06-01 17:52:25 +01:00
daniel tygel
b8e26ddf3d add labels to language picker 2017-06-01 09:48:36 -03:00
Matthew Hodgson
d021598380 fix typo 2017-06-01 02:04:43 +01:00
Kegan Dougal
1ab52652f7 Strip out sanitizeHtml stuff as it's not required
As per https://github.com/matrix-org/matrix-react-sdk/pull/968#issuecomment-304946341
2017-05-31 09:29:43 +01:00
Kegan Dougal
63a998ceb7 Allow span... 2017-05-30 17:37:13 +01:00
Kegan Dougal
1d67358525 Make it work with multiple regexps 2017-05-30 16:17:42 +01:00
Kegan Dougal
bb030dabc4 Add _tJsx() 2017-05-30 15:55:21 +01:00
Michael Telatynski
c614c03b03 fix i18n in a situation where navigator.languages=[]
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2017-05-29 19:59:29 +01:00
David Baker
477396f820 Use first language preference, not last 2017-05-26 22:29:03 +01:00
David Baker
0f8e560247 Add function to display i18n keys in UI
Avoids having to load translations in riot-web tests
2017-05-26 15:29:11 +01:00
David Baker
e7fbf889fa Make current language more accurate
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.
2017-05-25 19:53:27 +01:00
David Baker
39dbc4c6e1 Lots of changes to languageHandler
* 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.
2017-05-25 16:45:32 +01:00
David Baker
db45e99536 Remove defaulting here
We already do it in the place this function gets called
2017-05-25 12:09:48 +01:00
David Baker
913723b76b Remove extCounterpart now we only use one instance 2017-05-25 12:08:14 +01:00
David Baker
ec146c7f45 Switch to stock counterpart
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.
2017-05-25 11:24:17 +01:00
David Baker
f412552c2c Fix imports/exports 2017-05-23 18:32:45 +01:00
David Baker
d419c42a4f Squash merge https://github.com/matrix-org/matrix-react-sdk/pull/801 2017-05-23 15:16:31 +01:00