Titanium Locale Module for Both (Android and iOS)

In this post I am going to introduce to Locale module. This module helps to force the phone language only in your application. And you can just follow same i18n folder with your locale strings XML files (For example :- “en” folder >  strings.xml …).

Locale Titanium module
Locale Titanium module

To load Locale module into your app, write below one line code.
var locale = require("com.shareourideas.locale");

After loading you need to force locale in your application, just call setLocale method with language.

This above code helps to refer Spanish locale strings. Then if you try some thing like this.
Ti.API.info("This is just for test" + L("welcome_message"));

It will print Spanish locale string (from “es” folder > strings.xml). To get current locale you can use default Titanium property Ti.Locale.currentLanguage.

You can see example code in module folder and documentation as well. By the way make sure you tested your app after adding this locale module.

This module is free to trial and available for both Android and iOS from Appcelerator Titanium marketplace. Here are the download links.

Download Android Locale Module

Download iOS Locale Module
  • Pingback: This Week in Titanium Mobile Development: 9 Dec 2013 | Titanium Development()

  • Pingback: This Week in Titanium Mobile Development: 9 Dec 2013 | TiDev()

  • Le Minh

    Hello, your Locale Modules for iOS are very interessting. Are you going to update them to support iOS 64 bit. Thank you!

    • Soon I will update 64 bit module.. Sorry for the delay…!

      • Le Minh

        when you’re done, we look forward to your short message… Thank you!

      • Srinivas

        Hi, any progress on the 64-bit so far..

  • Digitalico

    Please, update them to x64 bits!! I need these modules for my new projects!!

  • Alex Foong

    We are using your Locale modules for iOS. Can you update them to 64-bit and PM me?

  • CMO

    Please update the iOS module for 64-bit support. Thanks

  • Le Minh

    Sorry but is the update difficult or you don’t have time? We can help!

  • urgent caller

    64-bit version ready? – We need it.

  • juanblo

    Thanks, great module ! Do you need help for 64-bits support ? I can help you with the process.

  • Anna Kozynenko

    We need to publish our application asap, and Appstore will reject it because the module is lacking 64-bit support. It takes 3 minutes to update, but there is no source code 🙁

  • Srinivas

    We are using your com.shareourideas.locale modules for iOS.
    While running on different simulator devices,It is working on few devices only not in all devices.
    We are getting below error.

    Script Error Couldn’t find module: com.shareourideas.locale for architecture: x86_64

    Please update the iOS module for 64-bit support.

  • Hi All,
    We build for 64-bit support. Upload to Appcelerator market place also waiting for approval.

    If you need, please drop me your email ID in comment. so that I can help you.

    Thank you.

    • AND

      Thanks! Please add to github.

      • Hi Can you please use Top Market place link.

        • AND

          Top Market place link – application is not available.

          • I am sorry. With my login I can see. Anyway I will Drop a shared link with .ZIP access

    • rjgijsbertsen

      Hi we also need a 64-bit version of this module asap. Could you upload to Github or mail me at robert-jan at media-artists dot nl? Thanks!

  • Steffanb

    resetLocale() doesn’t work on iOS.. undefined is not a function..

    • I will check and get back you. If any problem I will update the build.

      For now try use setLocale method and pass some dummy chars.. and try!

      • Steffanb

        In the Android module i am also getting an error

        • It seems this is not module related error. can you please check in sample…

          • Steffanb

            You are totally right.. Very sorry!!

  • Filipe

    Hi, sorry to ask for help here, but I couldn’t find another way. Is it a bug or I’m doing something wrong that I can’t change locale using country codes in android. I have en, us, pt-rBR and pt-rPT locales. They work fine using the system locale but when I try to change it does nothing for the pt languages. I’ve tried multiple things (pt, pt-BR, pt-rBR).
    In iOS it works fine, the folders are differente but the module changes correctly.

  • Altaf Hussain

    I am thinking of purchasing this module for one of my application, but before i do, I have a few questions. Hopefully I will get reply as soon as possible:

    1) Is this module compatible with Alloy?
    2) Can we use titanium L method with this module?
    3) If I buy this module, it will work for a single application and does not matter how many times that application is installed?
    4) Is this module compatible with latest SDK 5.x?
    5) Can i use this module to change the application language without reloading the complete application? I mean in-app language change?

    Kindly reply me asap.

    Thank you

    • Hi @Altaf Hussain ,
      First Thank you for buying!

      1) Yes, It will work same you have to use titleid textid in .tss and .XML or L(“STRING_NAME”) in .tss, .js

      2) Yes L method only helps to return string

      3) Yep, current policy is like that only. I hope this policy will not change.

      4) Recent tested with latest SDK and it works same.

      5) Yes, you no need to close the app and open again. But after changing the language, we have to re-render text, title values again.. then only it will effect.

      Thank you,
      Naga Harish.

      • Altaf Hussain

        Hello Naga Harish,
        Thanks for your eply. I did not understand the answer 5. Is not your module rendering the text, titles for the selected language itself?


        • Hi @disqus_h6YAputdVm:disqus ,

          I mean, if windows is opened already UI will be render (displayed) and it will add title or text based on currently. After that if you changed locale lang and came back to this screen by click back button it will still show old rendered labels texts only. For that we need re open the window or just update labels based on locale changed. I will recommend to show loader saving applying changes… in background close the current window or nav group and open it again. Than it will work as it is.

          I hope you understand now. Feel free if you still need my help..!

          Thank you,
          Naga Harish.

          • Altaf Hussain

            Hi Naga Harish,

            What about the currently opened window, on which I change the language? Will it be displayed in the selected language when the language is changed, or I have to reload it also?


          • You have to reload.. That is what I want to saying.. But I am missing somewhere.. (It is not possible, because ui already render by OS on screen before you changing language)…

          • Altaf Hussain

            This is something i want to do, to reload the windows seamlessly so that the user of the app dont know. Like in native apps, or other apps, if you change the language, all titles are changed accordingly. They may be reloading the windows, but it is so seamless and fast that it does not effect the display.

            Do you think there is any module which can do this for me using that module with yours?


          • I don’t think it is possible in native app also. with out reassigning value, title and texts to views.

            There is another without re opening windows:
            function init(){

            Helps to render text, values and titles
            function renderLocales(){
            $.label.text = L(“WELCOME”);

            function onWindowFocus(){
            if(Alloy.Globals.localeChanged) //This localeChanged value will be true when user changed the locale in setting screen..
            Alloy.Globals.localeChanged = false;

            or instead of window focus, you can also use Global event listeners.

            Think of those above approaches. Rendered UI can’t changed until reassign values to them again.

            Thank you,
            Naga Harish.

  • Christoph Eck


    Could you please update your android module for Titanium SDK 6.0. There is a short step by step documentation at http://skypanther.com/2016/10/rebuilding-modules-for-titanium-6/

    Kindly reply me asap.

    Thank you

    • Hi Dude,

      I updated the module to Appc store. They had issue with my account so removed my previous marketplace modules. And they asked me to upload newly. I did that one month back itself. Please subscribe new version Locale for Android and use. From two users I got personal feedback saying the new module works fine with Ti SDK 6.0.
      if you need more details please contact me in mail nagaharish.movva[@]gmail dot com

      Thank you,
      Naga Harish.

  • Ahmed Said

    “Found incompatible Titanium Modules” for android 0.1 version on Ti 6.0 SDK, can you give a download link for android version that works fine with Ti 6.0?