Merge branch 'master' of github.com:systemed/iD

This commit is contained in:
Tom MacWright
2013-02-12 15:21:40 -05:00
16 changed files with 71 additions and 64 deletions

View File

@@ -4,7 +4,7 @@ iD.modes.AddArea = function(context) {
button: 'area',
title: t('modes.add_area.title'),
description: t('modes.add_area.description'),
key: t('modes.add_area.key')
key: '4'
};
var behavior = iD.behavior.AddWay(context)

View File

@@ -4,7 +4,7 @@ iD.modes.AddLine = function(context) {
button: 'line',
title: t('modes.add_line.title'),
description: t('modes.add_line.description'),
key: t('modes.add_line.key')
key: '3'
};
var behavior = iD.behavior.AddWay(context)

View File

@@ -3,7 +3,7 @@ iD.modes.AddPoint = function(context) {
id: 'add-point',
title: t('modes.add_point.title'),
description: t('modes.add_point.description'),
key: t('modes.add_point.key')
key: '2'
};
var behavior = iD.behavior.Draw(context)

View File

@@ -4,7 +4,7 @@ iD.modes.Browse = function(context) {
id: 'browse',
title: t('modes.browse.title'),
description: t('modes.browse.description'),
key: t('modes.browse.key')
key: '1'
};
var behaviors = [

View File

@@ -51,7 +51,9 @@ iD.svg.Midpoints = function(projection) {
groups.attr('transform', iD.svg.PointTransform(projection));
groups.select('circle');
// Propagate data bindings.
groups.select('circle.shadow');
groups.select('circle.fill');
groups.exit()
.remove();

View File

@@ -3,25 +3,21 @@ locale.de = {
add_area: {
title: "Fläche",
description: "Füge Parks, Gebäude, Seen oder andere Flächen zur Karte hinzu.",
tail: "Klicke in die Karte, um das Zeichnen einer Fläche wie einen Park, einen See oder Gebäude zu starten.",
key: "A"
tail: "Klicke in die Karte, um das Zeichnen einer Fläche wie einen Park, einen See oder Gebäude zu starten."
},
add_line: {
title: "Linie",
description: "Linien können Autobahnen, Straßen, Fußwege oder sogar Kanäle sein.",
tail: "Klicke in die Karte, um das Zeichnen einer Straße eines Pfades oder einer Route zu starten.",
key: "L"
tail: "Klicke in die Karte, um das Zeichnen einer Straße eines Pfades oder einer Route zu starten."
},
add_point: {
title: "Punkt",
description: "Restaurants, Denkmäler und Briefkästen sind Punkte",
tail: "Klicke in die Karte, um einen Punkt hinzuzufügen.",
key: "P"
tail: "Klicke in die Karte, um einen Punkt hinzuzufügen."
},
browse: {
title: "Navigation",
description: "Verschieben und Vergrößern/Verkleinern des Kartenausschnitts.",
key: "B"
description: "Verschieben und Vergrößern/Verkleinern des Kartenausschnitts."
},
draw_area: {
tail: "Klicke, um Punkte zur Fläche hinzuzufügen. Klicke auf den ersten Punkt, um die Fläche abzuschließen."

View File

@@ -3,25 +3,21 @@ locale.en = {
add_area: {
title: "Area",
description: "Add parks, buildings, lakes, or other areas to the map.",
tail: "Click on the map to start drawing an area, like a park, lake, or building.",
key: "A"
tail: "Click on the map to start drawing an area, like a park, lake, or building."
},
add_line: {
title: "Line",
description: "Lines can be highways, streets, pedestrian paths, or even canals.",
tail: "Click on the map to start drawing an road, path, or route.",
key: "L"
tail: "Click on the map to start drawing an road, path, or route."
},
add_point: {
title: "Point",
description: "Restaurants, monuments, and postal boxes are points.",
tail: "Click on the map to add a point.",
key: "P"
tail: "Click on the map to add a point."
},
browse: {
title: "Browse",
description: "Pan and zoom the map.",
key: "B"
description: "Pan and zoom the map."
},
draw_area: {
tail: "Click to add points to your area. Click the first point to finish the area."

View File

@@ -3,25 +3,21 @@ locale.es = {
add_area: {
title: "Zona", //"Area",
description: "Agregar parques, edificios, lagos u otras zonas en el mapa", //"Add parks, buildings, lakes, or other areas to the map.",
tail: "Hacer click en el mapa para empezar a dibujar una zona como un parque, lago o edificio", //"Click on the map to start drawing an area, like a park, lake, or building.",
key: "Z" //"A"
tail: "Hacer click en el mapa para empezar a dibujar una zona como un parque, lago o edificio" //"Click on the map to start drawing an area, like a park, lake, or building."
},
add_line: {
title: "Línea", //"Line",
description: "Las líneas pueden ser autopistas, calles, pasos peatonales o canales.", //"Lines can be highways, streets, pedestrian paths, or even canals.",
tail: "Hace clic para dibujar en el mapa, una calle, camino o ruta.", //"Click on the map to start drawing an road, path, or route.",
key: "L"
tail: "Hace clic para dibujar en el mapa, una calle, camino o ruta." //"Click on the map to start drawing an road, path, or route.",
},
add_point: {
title: "Punto", //"Point",
description: "Son puntos los restaurantes, monumentos y buzones", //"Restaurants, monuments, and postal boxes are points.",
tail: "Hacer clic para agregar un punto en el mapa", //"Click on the map to add a point.",
key: "P"
tail: "Hacer clic para agregar un punto en el mapa" //"Click on the map to add a point.",
},
browse: {
title: "Navegar", //"Browse",
description: "Aumentar y navegar el mapa", //"Pan and zoom the map.",
key: "N" //"B"
description: "Aumentar y navegar el mapa" //"Pan and zoom the map.",
},
draw_area: {
tail: "Hacer clic para agregar puntos en tu zona. Hacer hacer click en el primer punto para finalizar la zona." //"Click to add points to your area. Click the first point to finish the area."

View File

@@ -3,25 +3,21 @@ locale.fr = {
add_area: {
title: "Polygone",
description: "Les polygones peuvent être des parcs, des batîments, des lacs ou tout autre objet surfacique.",
tail: "Cliquez sur la carte pour ajouter un polygone tel qu'un parc, un lac ou un bâtiment.",
key: "A"
tail: "Cliquez sur la carte pour ajouter un polygone tel qu'un parc, un lac ou un bâtiment."
},
add_line: {
title: "Ligne",
description: "Les lignes peuvent être des autoroutes, des routes, des chemins ou encore des caneaux.",
tail: "Cliquez sur la carte pour ajouter une nouvelle ligne telle qu'une route ou un nouveau chemin.",
key: "L"
tail: "Cliquez sur la carte pour ajouter une nouvelle ligne telle qu'une route ou un nouveau chemin."
},
add_point: {
title: "Point",
description: "Les points peuvent être des restaurants, des monuments, ou encore des boites aux lettres.",
tail: "Cliquez sur la carte pour ajouter un point tel qu'un restaurant ou un monument.",
key: "P"
tail: "Cliquez sur la carte pour ajouter un point tel qu'un restaurant ou un monument."
},
browse: {
title: "Navigation",
description: "Naviguer ou zoomer sur la carte.",
key: "B"
description: "Naviguer ou zoomer sur la carte."
},
draw_area: {
tail: "Cliquez pour ajouter un point à la zone. Cliquez sur le dernier point pour fermer la zone."

View File

@@ -3,25 +3,21 @@ locale.ja = {
add_area: {
title: "エリア",
description: "公園や建物、湖沼、をマップに追加します",
tail: "マップをクリックすると、公園や湖沼、建物などのエリアの描画が開始されます。",
key: "A"
tail: "マップをクリックすると、公園や湖沼、建物などのエリアの描画が開始されます。"
},
add_line: {
title: "ライン",
description: "ラインは車両用の道路や歩道、用水路を表すことができます",
tail: "マップをクリックすると、道路や歩道、流水経路の描画が始まります",
key: "L"
tail: "マップをクリックすると、道路や歩道、流水経路の描画が始まります"
},
add_point: {
title: "ポイント",
description: "レストランや記念碑、郵便ボックスはポイントで表現します",
tail: "マップをクリックするとポイントを追加できます",
key: "P"
tail: "マップをクリックするとポイントを追加できます"
},
browse: {
title: "ブラウズ",
description: "マップを拡大縮小します",
key: "B"
description: "マップを拡大縮小します"
},
draw_area: {
tail: "クリックするとエリア上にポイントを追加できます。起点となっているポイントをクリックするとエリアが作成されます"

View File

@@ -6,9 +6,11 @@ locale.current = function(_) {
return locale;
};
function t(s, o) {
function t(s, o, loc) {
loc = loc || locale._current;
var path = s.split(".").reverse(),
rep = locale[locale._current];
rep = locale[loc];
while (rep !== undefined && path.length) rep = rep[path.pop()];
@@ -16,6 +18,9 @@ function t(s, o) {
if (o) for (var k in o) rep = rep.replace('{' + k + '}', o[k]);
return rep;
} else {
if (console) console.error('key ' + s + ' not found');
var missing = 'Missing translation: ' + s;
if (console) console.error(missing);
if (loc !== 'en') return t(s, o, 'en');
return missing;
}
}

View File

@@ -3,25 +3,21 @@ locale.lv = {
add_area: {
title: "Apgabals",
description: "Pievieno parkus, ēkas, ezerus un citus apgabalus.",
tail: "Klikšķiniet uz kartes, lai sāktu zīmēt apgabalu, piemēram, parku, ezeru, vai ēku.",
key: "A"
tail: "Klikšķiniet uz kartes, lai sāktu zīmēt apgabalu, piemēram, parku, ezeru, vai ēku."
},
add_line: {
title: "Līnija",
description: "Līnijas var būt ceļi, ielas, takas vai pat kanāli.",
tail: "Klikšķiniet uz kartes, lai sāktu zīmēt līniju, piemēram, ceļu vai taku.",
key: "L"
tail: "Klikšķiniet uz kartes, lai sāktu zīmēt līniju, piemēram, ceļu vai taku."
},
add_point: {
title: "Punkts",
description: "Kafejnīcas, pieminekļi, un veikali var būt punkti.",
tail: "Klikšķiniet uz kartes, lai pievienotu interešu punktu.",
key: "P"
tail: "Klikšķiniet uz kartes, lai pievienotu interešu punktu."
},
browse: {
title: "Pārlūkot",
description: "Pārlūko karti.",
key: "B"
description: "Pārlūko karti."
},
draw_area: {
tail: "Klikšķiniet, lai pievinotu mezglus apgabalam. Lai beigtu zīmēt apgabalu, klikšķiniet uz sākuma mezgla."

View File

@@ -3,25 +3,21 @@ locale.tr = {
add_area: {
title: "Alan",
description: "Park, bina, göl ve benzeri alanları haritaya ekle.",
tail: "Park, göl ya da bina gibi alanları çizmek için haritaya tıklayın.",
key: "A"
tail: "Park, göl ya da bina gibi alanları çizmek için haritaya tıklayın."
},
add_line: {
title: "Çizgi",
description: "Yollar, sokaklar, patikalar ya da kanallar çizgi ile çizilebilir.",
tail: "Yol, patika yada rota çizmek için haritaya tıklayın.",
key: "L"
tail: "Yol, patika yada rota çizmek için haritaya tıklayın."
},
add_point: {
title: "Nokta",
description: "Restoranlar, anıtlar ya da posta kutuları nokta ile gösterilebilir.",
tail: "Nokta eklemek için haritaya tıklayın.",
key: "P"
tail: "Nokta eklemek için haritaya tıklayın."
},
browse: {
title: "Tara",
description: "Harita üzerinde dolan ve yaklaş.",
key: "B"
description: "Harita üzerinde dolan ve yaklaş."
},
draw_area: {
tail: "Alanınıza nokta eklemek için tıklayınız. İlk noktaya tıklayarak alan çizimini bitirebilirsiniz."

View File

@@ -144,6 +144,7 @@
<!-- include spec files here... -->
<script src="spec/lib/d3.keybinding.js"></script>
<script src="spec/lib/locale.js"></script>
<script src="spec/actions/add_midpoint.js"></script>
<script src="spec/actions/add_entity.js"></script>

View File

@@ -22,6 +22,7 @@
<!-- include spec files here... -->
<script src="spec/lib/d3.keybinding.js"></script>
<script src="spec/lib/locale.js"></script>
<script src="spec/actions/add_midpoint.js"></script>
<script src="spec/actions/add_entity.js"></script>

26
test/spec/lib/locale.js Normal file
View File

@@ -0,0 +1,26 @@
describe("locale", function() {
var saved, error;
beforeEach(function() {
saved = locale;
error = console.error;
console.error = function () {};
locale = { _current: 'en', en: {test: 'test', foo: 'bar'}, __: {}}
});
afterEach(function() {
locale = saved;
console.error = error;
});
describe("t", function() {
it("defaults to locale._current", function() {
expect(t('test')).to.equal('test');
});
it("falls back to en", function() {
locale._current = '__';
expect(t('test')).to.equal('test');
});
});
});