Skip to content

Commit

Permalink
Support for fr-FR LANG (#172)
Browse files Browse the repository at this point in the history
  • Loading branch information
simojenki authored Sep 14, 2023
1 parent a9d88bd commit 9786d9f
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 4 deletions.
43 changes: 42 additions & 1 deletion src/i8n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { option as O } from "fp-ts";
import _ from "underscore";

export type LANG = "en-US" | "da-DK" | "de-DE" | "es-ES" | "fr-FR" | "it-IT" | "ja-JP" | "nb-NO" | "nl-NL" | "pt-BR" | "sv-SE" | "zh-CN"
export type SUPPORTED_LANG = "en-US" | "da-DK" | "nl-NL";
export type SUPPORTED_LANG = "en-US" | "da-DK" | "fr-FR" | "nl-NL";
export type KEY =
| "AppLinkMessage"
| "artists"
Expand Down Expand Up @@ -129,6 +129,47 @@ const translations: Record<SUPPORTED_LANG, Record<KEY, string>> = {
LOVE: "Synes godt om",
LOVE_SUCCESS: "Syntes godt om"
},
"fr-FR": {
AppLinkMessage: "Associer Sonos à $BNB_SONOS_SERVICE_NAME",
artists: "Artistes",
albums: "Albums",
tracks: "Pistes",
playlists: "Playlists",
genres: "Genres",
random: "Aléatoire",
topRated: "Les mieux notés",
recentlyAdded: "Récemment ajouté",
recentlyPlayed: "Récemment joué",
mostPlayed: "Les plus joué",
success: "Succès",
failure: "Échec",
expectedConfig: "Configuration attendue",
existingServiceConfig: "La configuration de service existe",
noExistingServiceRegistration: "Aucun enregistrement de service existant",
register: "Inscription",
removeRegistration: "Supprimer l'inscription",
devices: "Appareils",
services: "Services",
login: "Se connecter",
logInToBonob: "Se connecter à $BNB_SONOS_SERVICE_NAME",
username: "Nom d'utilisateur",
password: "Mot de passe",
successfullyRegistered: "Connecté avec succès",
registrationFailed: "Échec de la connexion !",
successfullyRemovedRegistration: "Inscription supprimée avec succès",
failedToRemoveRegistration: "Échec de la suppression de l'inscription !",
invalidLinkCode: "Code non valide !",
loginSuccessful: "Connexion réussie !",
loginFailed: "La connexion a échoué !",
noSonosDevices: "Aucun appareil Sonos",
favourites: "Favoris",
STAR: "Suivre",
UNSTAR: "Ne plus suivre",
STAR_SUCCESS: "Piste suivie",
UNSTAR_SUCCESS: "Piste non suivie",
LOVE: "Aimer",
LOVE_SUCCESS: "Pistes aimée"
},
"nl-NL": {
AppLinkMessage: "Sonos koppelen aan $BNB_SONOS_SERVICE_NAME",
artists: "Artiesten",
Expand Down
2 changes: 1 addition & 1 deletion tests/i8n.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ describe("i8n", () => {

describe("langs", () => {
it("should be all langs that are explicitly defined", () => {
expect(langs()).toEqual(["en-US", "da-DK", "nl-NL"]);
expect(langs()).toEqual(["en-US", "da-DK", "fr-FR", "nl-NL"]);
});
});

Expand Down
4 changes: 2 additions & 2 deletions tests/smapi.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,8 @@ describe("service config", () => {
"Sonos koppelen aan music land"
);

// no fr-FR translation, so use en-US
expect(sonosString("AppLinkMessage", "fr-FR")).toEqual(
// no pt-BR translation, so use en-US
expect(sonosString("AppLinkMessage", "pt-BR")).toEqual(
"Linking sonos with music land"
);
});
Expand Down

0 comments on commit 9786d9f

Please sign in to comment.