Skip to Content
0

Problem with Internationalization

Mar 29, 2017 at 04:39 PM

124

avatar image
Former Member

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.

sin-titulo.png (10.5 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Jun Wu Mar 30, 2017 at 12:03 AM
0

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)?

Show 9 Share
10 |10000 characters needed characters left characters exceeded
Former Member

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

0

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

0
Former Member
Jun Wu

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(),
                 ...

console.png (99.2 kB)
0

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

0
Former Member
Jun Wu

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.

0

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

0

Can you share your sample code in plunkr, please?

0
Former Member
A K

This is the code I hope I can help

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

0

Sorry but there are just too many undefined variables and codes pasted from your production code. Could you please provide us a minimal, clean, and executable plunker that showcases only your i18n problem? Try to minimize the problem scope so that we can better help you.

0
Akhilesh Upadhyay Apr 04, 2017 at 01:15 PM
0

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

Share
10 |10000 characters needed characters left characters exceeded