Skip to content

Commit 0c7e418

Browse files
fix(translations): add sl to acceptedLanguages (#9506)
<!-- Thank you for the PR! Please go through the checklist below and make sure you've completed all the steps. Please review the [CONTRIBUTING.md](https://github.com/payloadcms/payload/blob/main/CONTRIBUTING.md) document in this repository if you haven't already. The following items will ensure that your PR is handled as smoothly as possible: - PR Title must follow conventional commits format. For example, `feat: my new feature`, `fix(plugin-seo): my fix`. - Minimal description explained as if explained to someone not immediately familiar with the code. - Provide before/after screenshots or code diffs if applicable. - Link any related issues/discussions from GitHub or Discord. - Add review comments if necessary to explain to the reviewer the logic behind a change ### What? ### Why? ### How? Fixes # --> ### What? This PR adds `'sl'` to list of accepted languages, dedupes languages not implemented from langs that have been supported, and adjusts the string match for `'sl'` in importDateFNSLocale to the correct locale. ### Why? To fix TS errors and runtime errors encountered while adding Slovenian language to config, and then selecting it in `/account` view. ### How? - Addition of `'sl'` to `acceptLanguages` array - Change from `'sl'` to `'sl-SI'` in `importDateFNSLocale.ts` Fixes #9504 --------- Co-authored-by: Jessica Chowdhury <jessica@trbl.design>
1 parent 8383426 commit 0c7e418

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

packages/translations/src/importDateFNSLocale.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ export const importDateFNSLocale = async (locale: string): Promise<Locale> => {
9696
result = (await import('date-fns/locale/sk')).sk
9797

9898
break
99-
case 'sl':
99+
case 'sl-SI':
100100
result = (await import('date-fns/locale/sl')).sl
101101

102102
break

packages/translations/src/languages/sl.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import type { Language } from '../types.js'
1+
import type { DefaultTranslationsObject, Language } from '../types.js'
22

3-
export const slTranslations = {
3+
export const slTranslations: DefaultTranslationsObject = {
44
authentication: {
55
account: 'Račun',
66
accountOfCurrentUser: 'Račun trenutnega uporabnika',

packages/translations/src/utilities/languages.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ export const acceptedLanguages = [
2929
'rs-latin',
3030
'ru',
3131
'sk',
32+
'sl',
3233
'sv',
3334
'th',
3435
'tr',
@@ -70,7 +71,6 @@ export const acceptedLanguages = [
7071
* 'gu',
7172
* 'ha-Latn',
7273
* 'hi',
73-
* 'hr',
7474
* 'hy',
7575
* 'id',
7676
* 'ig-Latn',
@@ -108,7 +108,6 @@ export const acceptedLanguages = [
108108
* 'rw',
109109
* 'sd-Arab',
110110
* 'si',
111-
* 'sl',
112111
* 'sq',
113112
* 'sr-Cyrl-BA',
114113
* 'sr-Cyrl-RS',

0 commit comments

Comments
 (0)