Skip to content

Commit

Permalink
Merge branch 'praszuk/feat/i18n-translations'
Browse files Browse the repository at this point in the history
  • Loading branch information
praszuk committed Jul 26, 2022
2 parents debafc4 + d86b69f commit b8d95c3
Show file tree
Hide file tree
Showing 6 changed files with 129 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,20 @@
import static org.openstreetmap.josm.tools.I18n.tr;

public class BuildingsImportAction extends JosmAction {
static final String DESCRIPTION = tr("Buildings download action.");

static final String DESCRIPTION = tr("Import building at cursor position or replace/update selected.");
static final String TITLE = tr("Download building");
public BuildingsImportAction() {
super(
tr("Download building"),
null,
DESCRIPTION,
Shortcut.registerShortcut(
"download:building",
tr("Download building"),
KeyEvent.VK_1,
Shortcut.CTRL_SHIFT
),
true
TITLE,
null,
DESCRIPTION,
Shortcut.registerShortcut(
"download:building",
TITLE,
KeyEvent.VK_1,
Shortcut.CTRL_SHIFT
),
true
);
}

Expand Down Expand Up @@ -100,7 +100,7 @@ public static void performBuildingImport(DataSet currentDataSet) {
.filter(osmPrimitive -> osmPrimitive.getType() == OsmPrimitiveType.WAY)
.collect(Collectors.toList());
Way selectedBuilding = selected.size() == 1 ? (Way) selected.toArray()[0]:null;

// if (importedBuilding.hasTag("building", "house")){importedBuilding.put("building", "detached");} // TODO remove it
if (BuildingsDuplicateValidator.isDuplicate(currentDataSet, importedBuilding)){
if (selectedBuilding == null){
Logging.info("Duplicated building geometry. Not selected any building. Canceling!");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,19 @@ public void actionPerformed(ActionEvent actionEvent) {
BuildingsImportStats buildingsStats = BuildingsImportStats.getInstance();
LinkedHashMap<String, String> statsPanelData = new LinkedHashMap<>();
statsPanelData.put(
tr("Imported a new building"),
tr("New buildings"),
Integer.toString(buildingsStats.getImportNewBuildingCounter())
);
statsPanelData.put(
tr("Imported with full replace"),
tr("Buildings with full replace"),
Integer.toString(buildingsStats.getImportWithReplaceCounter())
);
statsPanelData.put(
tr("Imported with tags update"),
tr("Buildings with tags update"),
Integer.toString(buildingsStats.getImportWithTagsUpdateCounter())
);
statsPanelData.put(
tr("Total import action"),
tr("Total number of import actions"),
Integer.toString(buildingsStats.getTotalImportActionCounter())
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public boolean executeCommand() {

@Override
public String getDescriptionText() {
return tr("Add imported building");
return tr("Added building geometry");
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ private void handleException(Exception exception) {

if (exception instanceof IllegalArgumentException) {
// If user cancel conflict window do nothing
note = new Notification(tr("Canceled merging buildings."));
note = new Notification(tr("Canceled merging buildings!"));
note.setIcon(JOptionPane.WARNING_MESSAGE);

Logging.debug(
Expand All @@ -98,7 +98,7 @@ private void handleException(Exception exception) {
note = new Notification(tr(
"Cannot merge buildings!" +
" Old building may be connected with some ways/relations" +
" or not whole area is downloaded."
" or not whole area is downloaded!"
));
note.setIcon(JOptionPane.ERROR_MESSAGE);

Expand Down Expand Up @@ -153,7 +153,7 @@ private void updateGeometry(Way selectedBuilding, Way newBuilding) throws Illega

@Override
public String getDescriptionText() {
return tr("Replace geometry");
return tr("Replaced building geometry");
}

@Override
Expand Down
Binary file added src/main/po/pl.mo
Binary file not shown.
108 changes: 108 additions & 0 deletions src/main/po/pl.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) 2022 THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the josm-plugin_plbuildings package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: josm-plugin_plbuildings 1.4.2-2-gdebafc4-SNAPSHOT\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-07-27 01:09+0200\n"
"PO-Revision-Date: 2022-07-27 01:11+0200\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: pl\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 2.0.6\n"
"Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 "
"|| n%100>=20) ? 1 : 2);\n"

#: src/main/java/org/openstreetmap/josm/plugins/plbuildings/commands/AddBuildingGeometryCommand.java:71
msgid "Added building geometry"
msgstr "Dodano zaimportowany budynek"

#: src/main/java/org/openstreetmap/josm/plugins/plbuildings/actions/BuildingsStatsAction.java:16
msgid "Buildings import stats"
msgstr "Statystyki importowania budynków"

#: src/main/java/org/openstreetmap/josm/plugins/plbuildings/actions/BuildingsStatsAction.java:36
msgid "Buildings with full replace"
msgstr "Budynki z pełną podmianą"

#: src/main/java/org/openstreetmap/josm/plugins/plbuildings/actions/BuildingsStatsAction.java:40
msgid "Buildings with tags update"
msgstr "Budynki z aktualizacją tagów"

#. If user cancel conflict window do nothing
#: src/main/java/org/openstreetmap/josm/plugins/plbuildings/commands/ReplaceBuildingGeometryCommand.java:89
msgid "Canceled merging buildings!"
msgstr "Anulowano scalanie budynków!"

#: src/main/java/org/openstreetmap/josm/plugins/plbuildings/commands/ReplaceBuildingGeometryCommand.java:112
msgid ""
"Cannot merge buildings! Building has been wrongly replaced and data has been "
"broken!"
msgstr ""
"Nie można scalić budynków! Budynek został błędnie podmieniony i jego dane "
"zostały popsute!"

#: src/main/java/org/openstreetmap/josm/plugins/plbuildings/commands/ReplaceBuildingGeometryCommand.java:99
msgid ""
"Cannot merge buildings! Old building may be connected with some ways/"
"relations or not whole area is downloaded!"
msgstr ""
"Nie można scalić budynków! Stary budynek może być jeszcze połączony z "
"jakimiś liniami, być w relacjach albo nie znajduje się całkowicie w pobranym "
"obszarze!"

#: src/main/java/org/openstreetmap/josm/plugins/plbuildings/commands/ReplaceBuildingGeometryCommand.java:122
msgid "Cannot merge buildings! Unknown error!"
msgstr "Nie można scalić budynków! Nieznany błąd!"

#: src/main/java/org/openstreetmap/josm/plugins/plbuildings/actions/BuildingsImportAction.java:32
msgid "Download building"
msgstr "Pobierz budynek"

#: src/main/java/org/openstreetmap/josm/plugins/plbuildings/actions/BuildingsImportAction.java:31
msgid "Import building at cursor position or replace/update selected."
msgstr ""
"Importuj budynek w miejscu wskazywanym przez kursor lub/i wymień/aktualizuj "
"zaznaczony."

#: src/main/java/org/openstreetmap/josm/plugins/plbuildings/actions/BuildingsImportAction.java:142
msgid "Imported a new building"
msgstr "Zaimportowano nowy budynek"

#: src/main/java/org/openstreetmap/josm/plugins/plbuildings/actions/BuildingsStatsAction.java:32
msgid "New buildings"
msgstr "Nowe budynki"

#: src/main/java/org/openstreetmap/josm/plugins/plbuildings/commands/ReplaceBuildingGeometryCommand.java:156
msgid "Replaced building geometry"
msgstr "Podmieniono geometrię budynku"

#: src/main/java/org/openstreetmap/josm/plugins/plbuildings/actions/BuildingsStatsAction.java:15
msgid "Show buildings import stats"
msgstr "Pokaż statystyki importowania budynków"

#: src/main/java/org/openstreetmap/josm/plugins/plbuildings/actions/BuildingsStatsAction.java:44
msgid "Total number of import actions"
msgstr "Całkowita liczba akcji importów"

#: src/main/java/org/openstreetmap/josm/plugins/plbuildings/commands/UpdateBuildingTagsCommand.java:18
msgid "Updated building tags"
msgstr "Zaktualizowano tagi budynku"

#: src/main/java/org/openstreetmap/josm/plugins/plbuildings/actions/BuildingsImportAction.java:174
msgid "Updated building tags and geometry"
msgstr "Zaktualizowano tagi i geometrię budynku"

#. Plugin description for plbuildings
msgid "Import buildings from Polish public datasets."
msgstr "Importuj budynki z polskich publicznych zbiorów danych."

#. Translator credits (translators who want to be credited for their contributions can add their names here as the translation)
msgid "translator-credits"
msgstr "NieWnen"

0 comments on commit b8d95c3

Please sign in to comment.