Skip to content

getL10nData not working in Chrome #64

Open
@rhasan516

Description

@rhasan516

Hi, as part of porting Loqui (which uses this library) we are seeing a lot of undefined warning logs according to the following code:

function getL10nData(key, args, fallback) {
    var data = gL10nData[key]; // << basically gL10nData does not have the Key.
    if (!data) {
      consoleWarn('#' + key + ' is undefined.');
      if (!fallback) {
        return null;
      }
      data = fallback;
    }

It looks like load and parse l10n data is happening AFTER the warning is printed (set breakpoints, above code executes first before the loading is complete). The code in index.html is:

<script type="text/spacebars" name="welcome">        
    <h1>{{_ 'WelcomeTo' app.name}}</h1>
  </script>

However others are working:

<h1 data-l10n-id="Providers">Add accounts</h1> // << This works fine.

Thanks for your help.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions