Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-13853] i18n: textid should use text as hint

GitHub Issuen/a
TypeNew Feature
PriorityLow
StatusReopened
ResolutionUnresolved
Affected Version/sn/a
Fix Version/sn/a
ComponentsCore
Labelsi18n, internationalization
ReporterFokke Zandbergen
AssigneeUnknown
Created2013-05-09T14:03:16.000+0000
Updated2018-02-28T20:03:56.000+0000

Description

Often I use hint - the second parameter for L (Ti.Locale.getString) - to specify the default (English) text. In this way, I only have to provide a strings.xml for alternative languages. I think it would be a small but nice improvement to use the text property as the hint when a textid property is set. Right now, the text (title, message etc.) property is completely ignored if you have a textid (titleid, messageid etc.) property.

Comments

  1. Daniel Sefton 2013-05-10

    To complete this report, please could you provide a simple code example? Thanks.
  2. Fokke Zandbergen 2013-05-14

    Of course. The goal would be to make this:
       var label = Ti.UI.createLabel({ text: L('hello_world', 'Hello world!') });
       
    The same as:
       var label = Ti.UI.createLabel({ textid: 'hello_world', text: 'Hello word!' });
       
    In both cases, if hello_world is found in the strings.xml, then that text should be used. If not, then the hint/text Hello world! should be used.

JSON Source