Skip to content

Commit

Permalink
Fixed test case/simplified.
Browse files Browse the repository at this point in the history
  • Loading branch information
mihxil committed Oct 6, 2024
1 parent 0fc3fb7 commit cb624a1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import java.util.stream.Stream;

public class DisplayNames_en extends java.util.ListResourceBundle {
public class DisplayNames extends java.util.ListResourceBundle {
@Override
protected Object[][] getContents() {
return Stream.concat(
Expand Down
8 changes: 2 additions & 6 deletions src/main/java/org/meeuw/i18n/languages/ISO_639_Code.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,11 @@ static ISO_639_Code fromCode(String code) {
return ISO_639.iso639(code);
}

ResourceBundle DEFAULT = ResourceBundle.getBundle("org.meeuw.i18n.languages.DisplayNames", Locale.US);


default String getDisplayName(Locale locale) {
ResourceBundle bundle = ResourceBundle.getBundle("org.meeuw.i18n.languages.DisplayNames", locale);
if (bundle.containsKey(code())) {
return bundle.getString(code());
} else {
return DEFAULT.getString(code());
}
return bundle.getString(code());

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ public void deprecated() {

@Test
public void dutchSignLanguage() {
LanguageCode l = LanguageCode.get("sse").orElseThrow();
LanguageCode l = LanguageCode.get("dse").orElseThrow();

assertThat(l.refName()).isEqualTo("Dutch Sign Language");
assertThat(l.nameRecord().print()).isEqualTo("dse (Dutch Sign Language)");
Expand Down

0 comments on commit cb624a1

Please sign in to comment.