Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-26545] Android: Using global L() method for localization does not work if second argument is not supplied

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2019-02-25T22:17:50.000+0000
Affected Version/sn/a
Fix Version/sRelease 8.0.0, Release 7.5.1
ComponentsAndroid
Labelsn/a
ReporterHans Knöchel
AssigneeChristopher Williams
Created2018-11-10T20:19:20.000+0000
Updated2019-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);
};

Comments

  1. Hans Knöchel 2018-11-10

    PR: https://github.com/appcelerator/titanium_mobile/pull/10454
  2. Christopher Williams 2018-12-03

    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.
  3. Samir Mohammed 2018-12-04

  4. Gary Mathews 2019-02-25

    7_5_X: https://github.com/appcelerator/titanium_mobile/pull/10726

JSON Source