cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with Internationalization

Former Member
0 Kudos
214

Hi, I hope can you help me. Internationalization are only given in the controls page, but not the menu of my control sap.ui.uinified.Shell.

I'm working with manifest.json to specify the model i18n.

...
},
  "models": {
    "i18n": {
              "type": "sap.ui.model.resource.ResourceModel",
              "settings": {
	      "bundleName": "adois.ui.i18n.i18n"
	    }
    }
}
...

This way i18n Bind

var oToolbarShell = new sap.m.OverflowToolbar("idToolbarShell", {
	content : [
		new sap.m.Text("idTitleShell",{
		text: "{i18n>TitleShell}",
		}),
		new sap.m.ToolbarSpacer(),
                ...

in i18n.properties

TitleShell=IM TITLLE SHELL

Nota:The shell toolbar code is in controller of controlId especific in routing.

I attach an image.

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member227918
Active Contributor
0 Kudos

seems es file is not found, just keep these two files:

  1. i18n_en.properties or i18n.properties
  2. i18n_es.properties

and run your application in English or Spanis

junwu
Active Contributor
0 Kudos

what language you are using to run ui5 app? what property file you have prepared? do you have any idea about i18n(generally, not ui5's)?

Former Member
0 Kudos

1. Should I specify a language to run the application? I thought that the application detects the language of the browser and runs in that language, currently my browser is in the Spanish language Latin America.

2. I have the i18n.properties file and the i18n_ES.properties file

3. Sólo he leido las refencias del api y demos sobre i18n en ui5

junwu
Active Contributor
0 Kudos

look at console to see what language file it is trying to load

karthikarjun
Active Contributor
0 Kudos

Can you share your sample code in plunkr, please?

Former Member
0 Kudos

The properties file is loaded correctly, but the internationalization does not work from the driver of my root control id.

"routing": {
			"config": {
				"routerClass": "sap.m.routing.Router",
				"viewType": "XML", 
				"viewPath": "adois.ui.view",                              
				"controlId": "appMain",  <------ root control id
				"controlAggregation": "pages",
				"transition": "slide",
				"bypassed": {
					"target": "notFound"
				}
			},

app.view

<mvc:View
    controllerName="adois.ui.controller.App"
    xmlns="sap.m"
    xmlns:mvc="sap.ui.core.mvc"
    displayBlock="true">
    <NavContainer id="appMain"></NavContainer>   <------  root control id
</mvc:View>

in app.comtroller

sap.ui.define([
  "adois/ui/controller/BaseController",
  'sap/ui/model/Filter',
], function (BaseController, Filter) {
   "use strict";
   jQuery.sap.require("jquery.sap.storage");
   jQuery.sap.require("sap.m.MessageBox");
   return BaseController.extend("adois.ui.controller.App", {
        onInit: function () { 
                 ...
                 var oToolbarShell = new sap.m.OverflowToolbar("idToolbarShell", {
	           content : [
		        new sap.m.Text("idTitleShell",{
		        text: "{i18n>TitleShell}",
		        }),
		   new sap.m.ToolbarSpacer(),
                 ...

junwu
Active Contributor
0 Kudos

look at those red ones. can't u figure out?

Former Member
0 Kudos

It is not assumed that when the properties file for a particular region like i18n_es.properties can not be found the application looks for i18n.properties. The browser is configured in Spanish that is why you ask for those files but you can not find them and when you do not find them go to the i18n. If I did not find it would not show my texts in the page controls. But there if the shows the problem is with the root control. Apparently I did not let myself be understood.

junwu
Active Contributor
0 Kudos

sorry... don't know what u are talking....

Former Member
0 Kudos

This is the code I hope I can help

https://plnkr.co/edit/wRQjFQGpH2uWwNdrOOUu?p=preview