Commit graph

65 commits

Author SHA1 Message Date
Michael Telatynski
b5daba9026 Iterate over all instances of variable/tag for _t substitutions
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2019-08-22 18:17:08 +01:00
Michael Telatynski
e668b2f8bd delint languageHandler
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2019-08-14 12:29:48 +01:00
David Baker
54aaabac74 Initial support for ToS dialogs for IS/IM
as per MSC2140
2019-07-09 18:51:56 +01:00
Travis Ralston
3476be3327 Merge branch 'develop' into travis/feature/wellknown2 2019-05-20 19:50:02 -06:00
J. Ryan Stinnett
32c68feae2 Run translation substitution in 2 passes
By first substituting variables and then tags after, the translation handling
can now support strings with variables inside tags, such as:

"people <span>reacted with %(foo)s</span>"
2019-05-17 12:11:01 +01:00
Travis Ralston
bb6ee10d8c Add language features to support server config changes 2019-05-03 11:34:30 -06:00
David Baker
4f84311bde Use $webapp rather than Webapp 2019-03-01 12:03:04 +00:00
David Baker
f2328904cd stray semicolon 2019-03-01 11:48:48 +00:00
David Baker
53aceaa412 Add fallback for languages file
So we're not completely dependent on the alias being set
2019-03-01 11:44:44 +00:00
David Baker
63c6f600bf Use webpack alias to resolve the languages file
Hopefully this will end up simpler than having to figure out in
riot-web what the relative path is from react-sdk's
src/languageHandler.js to riot-web's webapp directory.
2019-03-01 11:30:50 +00:00
Bruno Windels
44bedb2084 fix unit tests without breaking the build 2019-02-20 09:36:18 +01:00
Bruno Windels
33858c8aff move this path to webpack config file
otherwise react-sdk wouldn't be able to build anymore
without riot-web in a specific location
2019-02-18 16:26:04 +01:00
Bruno Windels
f240efb36d get cache-busted url for languages.json through file-loader requiring it 2019-02-18 16:13:24 +01:00
Aaron Raimist
752d816780
Fix some more lint errors
Signed-off-by: Aaron Raimist <aaron@raim.ist>
2018-10-11 22:06:01 -05:00
David Baker
0557737f8d Don't modify original options arg 2018-01-16 17:45:29 +00:00
David Baker
3cadb9b587 Fall back for missing i18n plurals
Counterpart doesn't do fallback if there is a translation for the
base string in the preferred language but not the required
pluralisation. This meant that if someone added some plurals to a
language or a string, but not all, you'd get completely empty
strings in the interface.

Work around this in the wrapper function.
2018-01-12 16:21:30 +00:00
Stefan Parviainen
713230e082 Add option to also output original string
This is useful for debugging and testing

Signed-off-by: Stefan Parviainen <pafcu@iki.fi>
2017-12-09 21:21:31 +01:00
Stefan Parviainen
df8a8f61e2 Fix logging of missing substitution variables
Signed-off-by: Stefan Parviainen <pafcu@iki.fi>
2017-11-23 20:19:38 +01:00
Stefan Parviainen
414ee82582 Perform substitution on all parts, not just the last one
Signed-off-by: Stefan Parviainen <pafcu@iki.fi>

This way the substitutions don't need to appear in the same order in the
translated string.
2017-11-17 08:47:31 +01:00
pafcu
342378f48a
Add space after if 2017-11-16 12:19:56 +01:00
Stefan Parviainen
2c1618bc10 Fix conflict and update strings
Signed-off-by: Stefan Parviainen <pafcu@iki.fi>
2017-11-15 20:40:51 +01:00
Stefan Parviainen
ae252f7e59 Log if no match is found 2017-11-14 21:34:20 +01:00
Stefan Parviainen
788be67c75 Clarifications 2017-11-14 20:08:27 +01:00
Stefan Parviainen
772550a24a Dont't add empty nodes 2017-11-14 19:33:12 +01:00
Stefan Parviainen
3afbaf61e7 Refactor i18n stuff a bit 2017-11-13 20:19:33 +01:00
Travis Ralston
8282534f87 Add SettingsLevel enum; Move settings to own file.
Signed-off-by: Travis Ralston <travpc@gmail.com>
2017-11-03 23:19:45 -06:00
Travis Ralston
893c39bfbe Merge branch 'develop' into travis/granular-settings 2017-11-03 22:00:07 -06:00
Stefan Parviainen
15bafd6818 Convert from weblate to counterpart at runtime to make tests happy
Signed-off-by: Stefan Parviainen <pafcu@iki.fi>
2017-11-01 15:55:58 +01:00
Travis Ralston
0d3f0eaf98 Convert local settings to granular settings
This breaks language selection.

Signed-off-by: Travis Ralston <travpc@gmail.com>
2017-10-29 16:53:00 -06:00
Stefan Parviainen
f694fb24ff Fix merge-conflict
Signed-off-by: Stefan Parviainen <pafcu@iki.fi>
2017-10-11 20:02:14 +02:00
Luke Barnard
d3f9a3aeb5 Run eslint --fix
Fixing 1000s of lint issues. Some rules cannot be `--fix`ed but this goes some way to linting the entire codebase.
2017-10-11 17:56:17 +01:00
Stefan Parviainen
52f3e1295b Don't use string interpolation in _tJsx as it uses regexes for that
Signed-off-by: Stefan Parviainen <pafcu@iki.fi>
2017-10-11 09:14:11 +02:00
Stefan Parviainen
d4929b558e Add dummy translation function to mark translatable strings
Signed-off-by: Stefan Parviainen <pafcu@iki.fi>
2017-09-22 21:43:27 +02:00
Matthew Hodgson
946c439c28 hopefully fix https://github.com/vector-im/riot-web/issues/4166 2017-09-21 18:56:47 +01:00
Marcel
d34ba57adb Add missing returns 2017-08-24 16:42:32 +02:00
Marcel
88a0d34c2b Remove unused response_return variable 2017-08-24 15:40:52 +02:00
MTRNord
4a1ba01f44 fix deprecation warning 2017-08-13 00:56:37 +00:00
Richard van der Hoff
0d7cc59d99 replace q method calls with bluebird ones
```
find src test -name '*.js' |
    xargs perl -i -pe 's/q\.(all|defer|reject|delay|try|isFulfilled)\(/Promise.$1(/'
```
2017-07-12 18:05:40 +01:00
Richard van der Hoff
a06bd84213 replace imports of q with bluebird
update `package.json`

```
find src test -name '*.js' |
   xargs perl -i -pe 'if (/require\(.[qQ].\)/) { $_ = "import Promise from '\''bluebird'\'';\n"; }'

find src test -name '*.js' |
   xargs perl -i -pe 'if (/import [qQ]/) { $_ = "import Promise from '\''bluebird'\'';\n"; }'
```
2017-07-12 18:05:08 +01:00
Richard van der Hoff
f37608a4ea Avoid React warning from _tJsx (#1078) 2017-06-12 16:45:36 +01:00
Matthew Hodgson
184c2d5e58 Merge pull request #1015 from matrix-org/t3chguy/random_fix_1
fix copy and paste derp and rip out unused imports
2017-06-06 18:02:35 +01:00
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