Skip to Content

Welcome to my SAPUI5 Walkthrough, And Dive In blog series, where I’ll not only walkthrough the tutorial, but dive in, to explore the magic behind SAPUI5. Buckle up and sit tight, it’s gonna be a bumpy ride as I’m no expert in any way shape or form, just a humble learner who loves coding and likes to get to the bottom of things =。=

This is a fairly straight forward step, but let’s go a little bit further than what the tutorial shows us.

Let’s first create an file.


And also, make German as the default language in the Chrome browser language settings.


With those preparations done, let’s run our application, and see what will happen and more importantly, ask the question how.

We see german on the screen, yeah.


Here comes the questions:

(1) How does SAPUI5 pick up the browser language setting.

(2) How does SAPUI5 know which i18n file to load.

(3) How does {0} turn into ‘World’.

(1) How does SAPUI5 pick up the browser language setting.

During the Core class instantiation process, a new Configuration object will be created.


The configuration object will pick up our Browser language settings, and make the first entry (de) as the default language value.


(2) How does SAPUI5 know which i18n file to load.

We go back to the App.controller.js to instantiate an i18nModel object.


During the instantiation process, we’ll get the language code from the configuration object.


It continues to construct the correct url (base url + the sLocale code) for requesting the resource.


Having the resource loaded.


(3) How does {0} turn into ‘World’.

Start with getText method call.


getText invokes method.


Which does its regular expression magic to replace the pattern ‘{0}’ with value ‘World’.



Mission completed  


To report this post you need to login first.


You must be Logged on to comment or reply to a post.

    1. Former Member Post author

      Thanks Venkatesh 🙂

      You can try set a break point at line 39629 of the sap-ui-core-dbg.js, where the the configuration object was instantiated, reload the page, then step into it when break point stops.


      You’ll see how the navigator languages property was picked up 😀



Leave a Reply