diff --git a/src/i18n/en.js b/src/i18n/en.js index baf523fe..d835c0c3 100644 --- a/src/i18n/en.js +++ b/src/i18n/en.js @@ -5,7 +5,12 @@ this.recline.View.translations = this.recline.View.translations || {}; this.recline.View.translations['en'] = { 'date_required': "A date is required, check field field-date-format", 'backend_error': 'There was an error querying the backend', - 'Distance_km': 'Distance (km)' + 'Distance_km': 'Distance (km)', + flot_Group_Column: 'Group Column (Axis 1)', + + map_mapping: 'Coordinates source', + map_mapping_lat_lon: 'Latitude / Longitude fields', + map_mapping_geojson: 'GeoJSON field' } // diff --git a/src/i18n/pl.js b/src/i18n/pl.js index e5bc1daa..fb7a0bb4 100644 --- a/src/i18n/pl.js +++ b/src/i18n/pl.js @@ -3,40 +3,66 @@ this.recline.View = this.recline.View || {}; this.recline.View.translations = this.recline.View.translations || {}; this.recline.View.translations['pl'] = { - 'Grid': 'Tabela', - 'Graph': 'Wykres', - 'Map': 'Mapa', - 'Timeline': 'Oś czasu', - 'Search_data': 'Wyszukaj w danych', - 'Go': 'Szukaj', - 'Add': 'Dodaj', - 'Add_row': 'Dodaj wiersz', - 'Delete_row': 'Usuń wiersz', - 'Update': 'Zaktualizuj', - 'Cancel': 'Anuluj', - 'Filters': 'Filtry', - 'Add_filter': 'Dodaj filtr', - 'Remove_this_filter': 'Usuń filtr', - 'Fields': 'Kolumny', - 'Field': 'Kolumna', - 'Filter_type': 'Typ filtra', - 'Value': 'Wartość', - 'Range': 'Zakres', - 'Geo_distance': 'Odległość', - 'From': 'Od', - 'To': 'Do', - 'Longitude': 'Długość geograficzna', - 'Latitude': 'Szerokość geograficzna', - 'Distance_km': 'Odległość (km)', - 'backend_error': 'Wystąpił błąd połączenia z serwerem', - 'Unknown': '???', - 'Edit_this_cell': 'Edytuj komórkę', - 'date_required': "Data jest wymagana: sprawdź kolumnę field-date-format", - 'Show_field': 'Pokaż kolumnę', - 'Force_fit_columns': 'Dopasuj kolumny do zawartości', - 'Expand_and_collapse': 'Rozwiń i zwiń', + Grid: 'Tabela', + Graph: 'Wykres', + Map: 'Mapa', + Timeline: 'Oś czasu', + Search_data: 'Wyszukaj w danych', + Search: 'Szukaj', + Add: 'Dodaj', + Add_row: 'Dodaj wiersz', + Delete_row: 'Usuń wiersz', + Reorder_row: 'Przesuń wiersz', + Update: 'Zaktualizuj', + Cancel: 'Anuluj', + Filters: 'Filtry', + Add_filter: 'Dodaj filtr', + Remove_this_filter: 'Usuń filtr', + Fields: 'Kolumny', + Field: 'Kolumna', + Filter_type: 'Typ filtra', + Value: 'Wartość', + Range: 'Zakres', + Geo_distance: 'Odległość', + From: 'Od', + To: 'Do', + Longitude: 'Długość geograficzna', + Latitude: 'Szerokość geograficzna', + Distance_km: 'Odległość (km)', + backend_error: 'Wystąpił błąd połączenia z serwerem', + Unknown: '???', + Edit_this_cell: 'Edytuj komórkę', + date_required: "Data jest wymagana: sprawdź kolumnę field-date-format", + Show_field: 'Pokaż kolumnę', + Force_fit_columns: 'Dopasuj kolumny do zawartości', + Expand_and_collapse: 'Rozwiń i zwiń', - 'num_records': '{recordCount} rekordów' + flot_info: '
Jakie kolumny powinny zostać narysowane na wykresie?
\ +Wybierz je używając menu po prawej, a wykres pojawi się automatycznie.
', + Graph_Type: 'Typ wykresu', + Lines_and_Points: 'Linie z punktami', + Lines: 'Linie', + Points: 'Punkty', + Bars: 'Słupki poziome', + Columns: 'Słupki', + flot_Group_Column: 'Kolumna (Oś X)', + Please_choose: 'Proszę wybrać', + Remove: 'Usuń', + Series: 'Seria', + Axis_2: 'Oś Y', + Add_Series: 'Dodaj serię danych', + Save: 'Zapisz', + + map_mapping: 'Źródło koordynatów', + map_mapping_lat_lon: 'Szerokość i długość geo.', + map_mapping_geojson: 'Jedna kolumna typu GeoJSON', + Latitude_field: 'Kolumna szerokości geo. (WGS84)', + Longitude_field: 'Kolumna długości geo. (WGS84)', + Auto_zoom_to_features: 'Kadruj, aby pokazać wszytkie punkty', + Cluster_markers: 'Łącz pobliskie punkty w grupy', + + num_records: '{recordCount} rekordów' } // diff --git a/src/i18n/view.i18n.js b/src/i18n/view.i18n.js index 065850e5..d3a88717 100644 --- a/src/i18n/view.i18n.js +++ b/src/i18n/view.i18n.js @@ -8,8 +8,10 @@ Backbone.I18nView = Backbone.View.extend({ defaultLocale: 'en', locale: 'en', - initializeI18n: function(locale) { - this.locale = locale; + initializeI18n: function(locale, appHardcodedLocale) { + this.defaultLocale = appHardcodedLocale || 'en'; + this.locale = locale || this.defaultLocale; + // TODO implement cache //memoizeFormatConstructor(Intl.NumberFormat).getNumberFormat(); }, @@ -30,7 +32,14 @@ Backbone.I18nView = Backbone.View.extend({ } msg = defaultMessage; } - if (msg == null) { msg = key; } // TODO w domyślnym locale automatycznie usuwaj podkreślenia + if (msg == null) { + msg = key; + if (this.locale === this.defaultLocale) { + // no need to define lang entry for short sentences, just use underscores as spaces + msg = msg.replace(/_/g, ' '); + } + + } // TODO i18n documentation @@ -73,4 +82,4 @@ Backbone.I18nView = Backbone.View.extend({ 't': formatter, }; }, -}); +}); \ No newline at end of file diff --git a/src/view.flot.js b/src/view.flot.js index 0197b874..38616f51 100644 --- a/src/view.flot.js +++ b/src/view.flot.js @@ -22,14 +22,14 @@ this.recline.View = this.recline.View || {}; // // NB: should *not* provide an el argument to the view but must let the view // generate the element itself (you can then append view.el to the DOM. -my.Flot = Backbone.View.extend({ +my.Flot = Backbone.I18nView.extend({ template: ' \There\'s no graph here yet because we don\'t know what fields you\'d like to see plotted.
\ -Please tell us by using the menu on the right and a graph will automatically appear.
\ +Please tell us by using the menu on the right and a graph will automatically appear.
{{/t.flot_info}} \