简体   繁体   中英

Change locale - gxp viewer - Boundless OpenGeo

I'm using the Boundless sdk suite to develop a complete web application, which until now worked pretty well. However, following the Opengeo documentation ( http://suite.opengeo.org/opengeo-docs/webapps/gxp/viewer/locale.html ) changing the locale of the viewer, does not work for me as the documentation is unclear to me where to put the following statement:

GeoExt.Lang.set("fr");

So far everything I changed, I did in the app.js file. As the documentation states I should find the code block:

Ext.onReady(function() { 

but it does not say where it actually is. It's not in app.js, so I derive it has to be somewhere else. Once I started tempering with the various geoext/ext extensions I messed up my application.

The only way I am able to find the upper statement in app.js, is when I proceed to the next step (packaging the app), unpack the war file, and search for it in lib/app.js. But I cannot imagine this to be the solution.

I can't believe no one has asked this question before. Is it so obvious, or am am I just slow on the uptake?

I resolved the issue. It was actually quite simple.

The GeoExt statement must be in between your dependencies and the var app code block (in the app.js configuration file).

.
.
* @require locale/es.js
*/

GeoExt.Lang.set("es");

var app = new gxp.Viewer({

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM