Skip to content

Commit

Permalink
Rest of German translation
Browse files Browse the repository at this point in the history
  • Loading branch information
sciolizer committed Jan 18, 2016
1 parent 7cf8711 commit f94973c
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 15 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ Supported languages
-------------------

Language can be changed from English by changing the language.code property in `$BUKKIT/plugins/craftinomicon/config.yml`.
Currently supported languages are Brazilian Portuguese, English, some German, Russian, Simplified Chinese, and Traditional Chinese.
Currently supported languages are Brazilian Portuguese, English, German, Russian, Simplified Chinese, and Traditional Chinese.
Add your own translation to the [localization page](http://dev.bukkit.org/bukkit-plugins/craftinomicon/localization/)! If the pluralization is confusing, see my [guide to pluralization](https://github.com/sciolizer/craftinomicon/wiki/Localization).

Permissions
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package name.ball.joshua.craftinomicon.recipe.i18n.numeric;

import name.ball.joshua.craftinomicon.recipe.i18n.NumericMnemonicResolver;

public class GermanNumericMnemonicResolver implements NumericMnemonicResolver {

@Override
public Mnemonic resolve(int n) {
if (n == 1) return Mnemonic.one;
if (n == 2) return Mnemonic.two; // German doesn't actually have a special case for 2, but the translator chose to spell it out long hand.
return Mnemonic.other;
}

}
26 changes: 13 additions & 13 deletions src/main/resources/i18n/messages_de_DE.properties
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
numeric.mnemonic.resolver = name.ball.joshua.craftinomicon.recipe.i18n.numeric.OneAndOtherNumericMnemonicResolver
numeric.mnemonic.resolver = name.ball.joshua.craftinomicon.recipe.i18n.numeric.GermanNumericMnemonicResolver

navigation.back = Zurück
navigation.next = Vorwärts
navigation.previous = Zurück
recipe-click.num-recipes#few = ${num-recipes} recipes (Left-click)
recipe-click.num-recipes#many = ${num-recipes} recipes (Left-click)
recipe-click.num-recipes#one = 1 recipe (Left-click)
recipe-click.num-recipes#other = ${num-recipes} recipes (Left-click)
recipe-click.num-recipes#two = ${num-recipes} recipes (Left-click)
recipe-click.num-recipes#few = ${num-recipes} Rezepte (Linksklick)
recipe-click.num-recipes#many = ${num-recipes} Rezepte (Linksklick)
recipe-click.num-recipes#one = 1 Rezept (Linksklick)
recipe-click.num-recipes#other = ${num-recipes} Rezepte (Linksklick)
recipe-click.num-recipes#two = ${num-recipes} Rezepte (Linksklick)
title = Craftinomicon
type.crafting = The above recipe is for placing in a crafting grid.
type.furnace = The above recipe is for placing in a furnace.
usage-click.num-usages#few = ${num-usages} usages (Right-click)
usage-click.num-usages#many = ${num-usages} usages (Right-click)
usage-click.num-usages#one = 1 usage (Right-click)
usage-click.num-usages#other = ${num-usages} usages (Right-click)
usage-click.num-usages#two = ${num-usages} usages (Right-click)
type.crafting = Das oben angezeigte Rezept muss in einer Werkbank platziert werden.
type.furnace = Das oben angezeigte Rezept muss in einem Ofen platziert werden.
usage-click.num-usages#few = ${num-usages}-malige Benutzung (Rechtsklick)
usage-click.num-usages#many = ${num-usages}-malige Benutzung (Rechtsklick)
usage-click.num-usages#one = Einmalige Benutzung (Rechtsklick)
usage-click.num-usages#other = ${num-usages}-malige Benutzung (Rechtsklick)
usage-click.num-usages#two = Zweimalige Benutzung (Rechtsklick)
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,18 @@ public void testRussian() throws Exception {

@Test
public void testGerman() throws Exception {
assertEquals("Zurück", new MessageProvider(Locale.GERMANY).getMessage(String.class, "navigation.back", "Back"));
MessageProvider germanMessageProvider = new MessageProvider(Locale.GERMANY);

assertEquals("Zurück", germanMessageProvider.getMessage(String.class, "navigation.back", "Back"));

NumericTranslation numRecipesTranslation = germanMessageProvider.getMessage(NumericTranslation.class, "recipe-click.num-recipes", "${num-recipes} recipes (Left-click)");
assertEquals("1 Rezept (Linksklick)", numRecipesTranslation.getMessage(1));
assertEquals("7 Rezepte (Linksklick)", numRecipesTranslation.getMessage(7));

NumericTranslation numUsagesTranslation = germanMessageProvider.getMessage(NumericTranslation.class, "usage-click.num-usages", "${num-usages} usages (Right-click)");
assertEquals("Einmalige Benutzung (Rechtsklick)", numUsagesTranslation.getMessage(1));
assertEquals("Zweimalige Benutzung (Rechtsklick)", numUsagesTranslation.getMessage(2));
assertEquals("7-malige Benutzung (Rechtsklick)", numUsagesTranslation.getMessage(7));
}

private List<Locale> getLocales() {
Expand Down

0 comments on commit f94973c

Please sign in to comment.