diff --git a/js/src/graphql/user.ts b/js/src/graphql/user.ts index 190ecb35..d4afba21 100644 --- a/js/src/graphql/user.ts +++ b/js/src/graphql/user.ts @@ -106,6 +106,7 @@ export const USER_SETTINGS_FRAGMENT = gql` export const USER_SETTINGS = gql` query UserSetting { loggedUser { + locale settings { ...UserSettingFragment } @@ -189,3 +190,12 @@ export const GET_USER = gql` } } `; + +export const UPDATE_USER_LOCALE = gql` + mutation UpdateUserLocale($locale: String!) { + updateLocale(locale: $locale) { + id + locale + } + } +`; diff --git a/js/src/i18n/en_US.json b/js/src/i18n/en_US.json index 92271d7b..fad69569 100644 --- a/js/src/i18n/en_US.json +++ b/js/src/i18n/en_US.json @@ -644,5 +644,6 @@ "more than 1360 contributors": "more than 1360 contributors", "{moderator} has unsuspended profile {profile}": "{moderator} has unsuspended profile {profile}", "{moderator} has deleted user {user}": "{moderator} has deleted user {user}", - "Change timezone": "Change timezone" + "Change timezone": "Change timezone", + "Select a language": "Select a language" } diff --git a/js/src/i18n/fr_FR.json b/js/src/i18n/fr_FR.json index c93fec9e..68bdd12d 100644 --- a/js/src/i18n/fr_FR.json +++ b/js/src/i18n/fr_FR.json @@ -667,5 +667,6 @@ "more than 1360 contributors": "plus de 1360 contributeur·ices", "{moderator} has unsuspended profile {profile}": "{moderator} a annulé la suspension de {profile}", "{moderator} has deleted user {user}": "{moderator} a supprimé l'utilisateur·ice {user}", - "Change timezone": "Changer de fuseau horaire" + "Change timezone": "Changer de fuseau horaire", + "Select a language": "Choisissez une langue" } diff --git a/js/src/i18n/langs.json b/js/src/i18n/langs.json new file mode 100644 index 00000000..d9916fb7 --- /dev/null +++ b/js/src/i18n/langs.json @@ -0,0 +1,30 @@ +{ + "ar": "العربية", + "bg": "Български", + "be": "Беларуская мова", + "br": "Brezhoneg", + "ca": "Català", + "co": "Corsu", + "cs": "čeština", + "de": "Deutsch", + "en": "English", + "eo": "Esperanto", + "es": "Español", + "fi": "suomi", + "fr": "Français", + "gl": "Galego", + "hu": "Magyar", + "it": "Italiano", + "ja": "日本語", + "nl": "Dutch", + "oc": "Occitan", + "pl": "Polski", + "pt": "Português", + "pt_PT": "Português (Portugal)", + "ru": "Русский", + "sq": "Shqip", + "sv": "Svenska", + "tr": "Türkçe", + "vi": "Tiếng Việt", + "zh_Hant_TW": "繁體中文(台灣)" +} diff --git a/js/src/types/current-user.model.ts b/js/src/types/current-user.model.ts index 32742174..5eb7a203 100644 --- a/js/src/types/current-user.model.ts +++ b/js/src/types/current-user.model.ts @@ -17,12 +17,12 @@ export interface ICurrentUser { defaultActor: IPerson; drafts: IEvent[]; settings: IUserSettings; + locale: string; } export interface IUser extends ICurrentUser { confirmedAt: Date; confirmationSendAt: Date; - locale: String; actors: IPerson[]; disabled: boolean; } diff --git a/js/src/views/Settings/Preferences.vue b/js/src/views/Settings/Preferences.vue index f0efe199..7f28d4e1 100644 --- a/js/src/views/Settings/Preferences.vue +++ b/js/src/views/Settings/Preferences.vue @@ -1,5 +1,16 @@