[TIMOB-26545] Android: Using global L() method for localization does not work if second argument is not supplied
| GitHub Issue | n/a |
|---|---|
| Type | Bug |
| Priority | Critical |
| Status | Closed |
| Resolution | Fixed |
| Resolution Date | 2019-02-25T22:17:50.000+0000 |
| Affected Version/s | n/a |
| Fix Version/s | Release 8.0.0, Release 7.5.1 |
| Components | Android |
| Labels | n/a |
| Reporter | Hans Knöchel |
| Assignee | Christopher Williams |
| Created | 2018-11-10T20:19:20.000+0000 |
| Updated | 2019-02-25T22:19:17.000+0000 |
Description
If the
L method does not receive a second parameter, the fallback string is not displayed if not supplied as a second argument. This works fine on iOS.
Example:
// Works
L('Hello world', 'Hello world');
// Does not work on Android, works on iOS
L('Hello world');
This triggered TIMOB-26544 and is kind of a blocker for us.
*Update*: We now implemented a workaround using the ti.shell feature (in a L.bootstrap.js):
global.Lx = (value, comment) => {
return L(value, comment || value);
};
PR: https://github.com/appcelerator/titanium_mobile/pull/10454
If the supplied "default" value is a non-string, we now "reject" it and treat it as if no default fallback was given. If no default was given, the original key is returned when no corresponding value is found.
7_5_X: https://github.com/appcelerator/titanium_mobile/pull/10726