Uploaded image for project: 'Weex (Retired)'
  1. Weex (Retired)
  2. WEEX-139

Provide system language infomation

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 0.18
    • 0.18
    • Android, iOS

    Description

      Weex page has no idea about current system language now, multiple language application cannot decide default language of the user.

      Weex should provide locale module, contains information about system language, as same as navigator.language (referrer https://developer.mozilla.org/en-US/docs/Web/API/NavigatorLanguage/language).

      var locale = weex.requireModule('locale');
      // get preferred language of the user
      var language = locale.getLanguage()
      // an array of strings representing the user's preferred languages
      // referrer [https://developer.mozilla.org/en-US/docs/Web/API/NavigatorLanguage/languages]
      var languages = locale.getLanguages()
      

      Example: http://dotwe.org/vue/fc5e91d6f1a809bab2f073af53f4dd94

      Attachments

        Activity

          People

            zshshr Shihan Zheng
            CYJB Shaojun Yang
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 24h
                24h
                Remaining:
                Remaining Estimate - 24h
                24h
                Logged:
                Time Spent - Not Specified
                Not Specified