Skip to content

Commit

Permalink
Add Danish translation of word-based periods
Browse files Browse the repository at this point in the history
Originated from Kasper Laudrup, checked by SJC
  • Loading branch information
jodastephen committed Sep 27, 2012
1 parent 6d3a272 commit 136667c
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 2 deletions.
4 changes: 3 additions & 1 deletion RELEASE-NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ Enhancements since 2.1
- Add method to calculate the Julian Day
See DateTimeUtils

- Add Danish translation of word-based periods


Compatibility with 2.1
----------------------
Expand Down Expand Up @@ -86,7 +88,7 @@ Bug fixes since 2.1

- Javadoc fix to BaseChronology [3513326]

- Fixed Spanish translation of day - dia now has accented i
- Fixed Spanish translation of day for periods - dia now has accented i
https://github.com/JodaOrg/joda-time/pull/5


Expand Down
22 changes: 22 additions & 0 deletions src/main/java/org/joda/time/format/messages_da.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
PeriodFormat.space=\
PeriodFormat.comma=,
PeriodFormat.commandand=,og
PeriodFormat.commaspaceand=, og
PeriodFormat.commaspace=,\
PeriodFormat.spaceandspace=\ og\
PeriodFormat.year=\ år
PeriodFormat.years=\ år
PeriodFormat.month=\ måned
PeriodFormat.months=\ måneder
PeriodFormat.week=\ uge
PeriodFormat.weeks=\ uger
PeriodFormat.day=\ dag
PeriodFormat.days=\ dage
PeriodFormat.hour=\ time
PeriodFormat.hours=\ timer
PeriodFormat.minute=\ minut
PeriodFormat.minutes=\ minutter
PeriodFormat.second=\ sekund
PeriodFormat.seconds=\ sekunder
PeriodFormat.millisecond=\ millisekund
PeriodFormat.milliseconds=\ millisekunder
16 changes: 15 additions & 1 deletion src/test/java/org/joda/time/format/TestPeriodFormat.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,14 @@
* @author Stephen Colebourne
*/
public class TestPeriodFormat extends TestCase {

private static final Locale EN = new Locale("en");
private static final Locale FR = new Locale("fr");
private static final Locale PT = new Locale("pt");
private static final Locale ES = new Locale("es");
private static final Locale DE = new Locale("de");
private static final Locale NL = new Locale("nl");
private static final Locale DA = new Locale("da");

private Locale originalLocale = null;

Expand Down Expand Up @@ -298,6 +299,19 @@ public void test_wordBased_nl_cached() {
assertSame(PeriodFormat.wordBased(NL), PeriodFormat.wordBased(NL));
}

//-----------------------------------------------------------------------
// wordBased(Locale da)
//-----------------------------------------------------------------------
public void test_wordBased_da_formatMultiple() {
Period p = new Period(2, 3, 4, 2, 5, 6 ,7, 8);
assertEquals("2 \u00E5r, 3 m\u00E5neder, 4 uger, 2 dage, 5 timer, 6 minutter, 7 sekunder og 8 millisekunder", PeriodFormat.wordBased(DA).print(p));
}

public void test_wordBased_da_formatSinglular() {
Period p = new Period(1, 1, 1, 1, 1, 1, 1, 1);
assertEquals("1 \u00E5r, 1 m\u00E5ned, 1 uge, 1 dag, 1 time, 1 minut, 1 sekund og 1 millisekund", PeriodFormat.wordBased(DA).print(p));
}

//-----------------------------------------------------------------------
// Cross check languages
//-----------------------------------------------------------------------
Expand Down

0 comments on commit 136667c

Please sign in to comment.