Commit 5b5abbde authored by Adrien Pavie's avatar Adrien Pavie
Browse files

Translation of some map buttons in english

parent 96b14aba
......@@ -105,7 +105,7 @@ coreminifycss:
$(NM_FOLDER)/uglifycss/uglifycss --ugly-comments $(CSS_OUT) > $(CSS_MIN_OUT)
corebundleminifyjs:
$(BROWSERIFY) $(SRC_FOLDER)/js/OLU.js --s OLU | uglifyjs -c > $(JS_MIN_OUT)
$(BROWSERIFY) $(SRC_FOLDER)/js/OLU.js --s OLU | $(NM_FOLDER)/uglify-js/bin/uglifyjs -c > $(JS_MIN_OUT)
# Test
......
......@@ -366,17 +366,19 @@ var Main = function(divId, mode, config) {
* Init locales
*/
for(var lngId=0; lngId < this.config.locales.length; lngId++) {
//TODO
$.ajax({
url: this.config.locales[lngId],
async: false,
dataType: 'text',
success: function(data) {
var locale = yaml.safeLoad(data);
console.log(locale);
var localeName = Object.keys(locale)[0];
this.translator.addTranslation(localeName, locale[localeName]);
}.bind(this)
}).fail(function() { throw new Error("[Controller] Error while retrieving locales file: "+this.config.locales[lngId]); }.bind(this));
}
//Set locale according to browser
this.translator.setLocale(window.navigator.userLanguage || window.navigator.language);
/*
* Init main view
......@@ -390,6 +392,7 @@ var Main = function(divId, mode, config) {
this.search,
this.data.osm,
this.pictures.flickr,
this.translator.t.bind(this.translator),
options
);
......
......@@ -43,9 +43,10 @@ var Spinner = require("./Spinner");
* @param searchService The search service
* @param osmProvider The OSM data provider
* @param flickrProvider The flickr pictures provider
* @param t The translation function
* @param options Some init options, like { tile: integer, level: float }
*/
var Main = function(divId, mode, config, rulesets, newNoteService, searchService, osmProvider, flickrProvider, options) {
var Main = function(divId, mode, config, rulesets, newNoteService, searchService, osmProvider, flickrProvider, t, options) {
//ATTRIBUTES
/** The view mode (basic, advanced) **/
this.mode = (mode == "advanced") ? mode : "basic";
......@@ -130,7 +131,7 @@ var Main = function(divId, mode, config, rulesets, newNoteService, searchService
}
}.bind(this));
this.map.attributionControl.setPrefix('<img src="img/favicon.png" /> <a href="http://openlevelup.net">OpenLevelUp!</a>');
this.map.attributionControl.setPrefix('<img src="img/favicon.png" /> <a href="http://openlevelup.net">'+t("main.olu")+'</a>');
this.layersManager = new MapLayersManager(this.map);
var hash = new L.Hash(this.map);
......@@ -151,24 +152,24 @@ var Main = function(divId, mode, config, rulesets, newNoteService, searchService
function(btn, map){
this.side.show("newnote");
}.bind(this),
'Propose a map correction',
t("notes.desc"),
{ position: "topleft" }
);
var searchButton = L.easyButton(
'fa-search',
function(btn, map){ this.side.show("search"); }.bind(this),
'Find a place in the world'
t("search.desc")
);
var layersButton = L.easyButton(
'fa-globe',
function(btn, map){ this.side.show("layers"); }.bind(this),
'Change map background and style',
t("map.layers.desc"),
{ position: "bottomleft" }
);
var routingButton = L.easyButton(
'fa-map-signs',
function(btn, map){ this.side.show("routing"); }.bind(this),
'Find direction between two places'
t("routing.desc")
);
var navbar = L.easyBar([ searchButton, routingButton ], { position: "bottomright", id: "olu-control-navbar" });
var editorControl = new L.Control.EditInOSM({
......
en:
olu:
name: OpenLevelUp!
notes:
desc: Propose a map correction
search:
desc: Find a place in the world
map:
layers:
desc: Change map background and style
routing:
desc: Find direction between two places
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment