Skip to content

Commit

Permalink
Added Indonesian to story languages
Browse files Browse the repository at this point in the history
  • Loading branch information
StorytellerCZ committed Apr 27, 2023
1 parent 38de58d commit a5b10e5
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 8 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog for languages

## 2023-04-27 - v2.7.0

* Added Indonesian to story languages

## 2023-04-22 - v2.6.4

* Added `common.noAccountQuestion`, `common.haveAccountQuestion` and `common.socialLogin` for new entry screens
Expand Down
2 changes: 1 addition & 1 deletion package.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* global Package */
Package.describe({
name: 'lu-intl',
version: '2.6.4',
version: '2.7.0',
summary: 'Intl for Literary Universe',
documentation: 'README.md'
})
Expand Down
22 changes: 15 additions & 7 deletions settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,23 +147,23 @@ export default {
* Get the array of language codes of supported languages
* @returns {[String]}
*/
supportedLanguages(): string[] {
supportedLanguages (): string[] {
return this.languages.map((lang) => lang.code) || []
},
allSupportedLocales(): string[] {
allSupportedLocales (): string[] {
const supported = []
this.languages.forEach((lang) =>
lang.supportedLocales.forEach((locale) => supported.push(locale))
)
return supported
},
supportedLocalesForLanguage(languageCode: string): string[] {
supportedLocalesForLanguage (languageCode: string): string[] {
const langDetails = this.languages.find(
(lang) => lang.code === languageCode
)
return [langDetails.code, ...langDetails.supportedLocales]
},
findLanguageCodeByLocale(locale: string): string {
findLanguageCodeByLocale (locale: string): string {
if (locale.length === 2 && this.supportedLanguages().includes(locale)) {
return locale
}
Expand All @@ -181,7 +181,7 @@ export default {
* This includes stories supported through the app in addition to those listed here.
* @returns {({defaultLocale: string, code: string, supportedLocales: [string, string, string, string, string], native: string, name: string, rtl: boolean}|{defaultLocale: string, code: string, supportedLocales: [string], native: string, name: string, rtl: boolean}|{defaultLocale: string, code: string, supportedLocales: [string], native: string, name: string, rtl: boolean})[]}
*/
storyLanguages(): LanguageSettingsType[] {
storyLanguages (): LanguageSettingsType[] {
return [
...this.languages,
{
Expand Down Expand Up @@ -390,10 +390,18 @@ export default {
defaultLocale: 'vi-VN',
supportedLocales: ['vi-VN'],
rtl: false
},
{
code: 'id',
name: 'Indonesian',
native: 'Bahasa Indonesia',
defaultLocale: 'id-ID',
supportedLocales: ['id-ID'],
rtl: false
}
]
},
storyLocales(): string[] {
storyLocales (): string[] {
return this.storyLanguages().map((lang) => lang.code)
},
/**
Expand Down Expand Up @@ -436,7 +444,7 @@ export default {
* @param countryCode {String} 2-key country string
* @returns {String} 3-key currency string
*/
currencyByCountry(countryCode: string): string {
currencyByCountry (countryCode: string): string {
if (!countryCode) return 'EUR'
const code = countryCode.toUpperCase()
switch (code) {
Expand Down

0 comments on commit a5b10e5

Please sign in to comment.