Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: update language code to ar #6518

Merged
merged 1 commit into from
Aug 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .changeset/young-moons-deny.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
"@logto/phrases": minor
---

add ar-AR language (credit to @zaaakher)
add ar-SA language (credit to @zaaakher)
gao-sun marked this conversation as resolved.
Show resolved Hide resolved
6 changes: 3 additions & 3 deletions packages/phrases-experience/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { languages, fallback } from '@logto/language-kit';
import type { NormalizeKeyPaths } from '@silverhand/essentials';
import { z } from 'zod';

import arAR from './locales/ar-ar/index.js';
import ar from './locales/ar/index.js';
import de from './locales/de/index.js';
import en from './locales/en/index.js';
import es from './locales/es/index.js';
Expand All @@ -26,7 +26,7 @@ export type { LocalePhrase } from './types.js';
export type I18nKey = NormalizeKeyPaths<typeof en.translation>;

export const builtInLanguages = [
'ar-AR',
'ar',
'de',
'en',
'es',
Expand Down Expand Up @@ -56,7 +56,7 @@ export type BuiltInLanguageTag = z.infer<typeof builtInLanguageTagGuard>;
export type Resource = Record<BuiltInLanguageTag, LocalePhrase>;

const resource: Resource = {
'ar-AR': arAR,
ar,
de,
en,
es,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import mfa from './mfa.js';
import secondary from './secondary.js';
import user_scopes from './user-scopes.js';

const ar_ar = {
const ar = {
translation: {
input,
secondary,
Expand All @@ -26,4 +26,4 @@ const ar_ar = {
},
} satisfies DeepPartial<LocalePhrase>;

export default Object.freeze(ar_ar);
export default Object.freeze(ar);
6 changes: 3 additions & 3 deletions packages/phrases/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { languages, fallback } from '@logto/language-kit';
import type { DeepPartial, NormalizeKeyPaths } from '@silverhand/essentials';
import { z } from 'zod';

import arAR from './locales/ar-ar/index.js';
import ar from './locales/ar/index.js';
import de from './locales/de/index.js';
import en from './locales/en/index.js';
import es from './locales/es/index.js';
Expand All @@ -27,7 +27,7 @@ export type DefaultLocale = 'en';
export type I18nKey = NormalizeKeyPaths<typeof en.translation>;

export const builtInLanguages = [
'ar-AR',
'ar',
'de',
'en',
'es',
Expand Down Expand Up @@ -74,7 +74,7 @@ export type Resource = Record<
};

const resource: Resource = {
'ar-AR': arAR,
ar,
de,
en,
es,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import type { LocalePhrase } from '../../types.js';
import errors from './errors/index.js';
import translation from './translation/index.js';

const ar_ar = {
const ar = {
translation,
errors,
} satisfies DeepPartial<LocalePhrase>;

export default Object.freeze(ar_ar);
export default Object.freeze(ar);
4 changes: 3 additions & 1 deletion packages/toolkit/language-kit/src/const.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
export const languages = Object.freeze({
'af-ZA': 'Afrikaans',
'am-ET': 'አማርኛ',
'ar-AR': 'العربية',
ar: 'العربية',
/** @deprecated Use 'ar' instead. */
'ar-AR': 'العربية (مهجورة)',
'as-IN': 'অসমীয়া',
'az-AZ': 'Azərbaycan dili',
'be-BY': 'Беларуская',
Expand Down
Loading