Skip to content

Commit

Permalink
These make some sense too.
Browse files Browse the repository at this point in the history
  • Loading branch information
mihxil committed Jul 10, 2024
1 parent 0f79c04 commit c16776b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/main/java/org/meeuw/i18n/languages/ISO_639_Code.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ default NameRecord nameRecord(Locale locale) {
return nameRecord();
}

default NameRecord nameRecord(LanguageCode locale) {
return nameRecord(locale.toLocale());
}

default NameRecord nameRecord() {
return new NameRecord(toString());
}
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/org/meeuw/i18n/languages/LanguageCode.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ public interface LanguageCode extends ISO_639_Code {
.sorted(Map.Entry.comparingByKey());
}

static Stream<? extends Map.Entry<String, ? extends LanguageCode>> streamByNames(LanguageCode locale) {
return streamByNames(locale.toLocale());
}


/**
* Defaulting version of {@link #streamByNames(Locale)}, using {@link Locale#US}.
* @since 3.0
Expand Down

0 comments on commit c16776b

Please sign in to comment.