Skip to content

Commit

Permalink
yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
pontusab committed Jan 19, 2025
1 parent 18ee09b commit 02dd4f1
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 18 deletions.
2 changes: 1 addition & 1 deletion examples/yaml/languine.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { defineConfig } from "languine";
export default defineConfig({
locale: {
source: "en",
targets: ["es"],
targets: ["es", "fr"],
},
files: {
yaml: {
Expand Down
26 changes: 13 additions & 13 deletions examples/yaml/locales/es.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,34 +3,34 @@ goodbye: Gracias por usar nuestra app. ¡Hasta la próxima!
nav:
home: Inicio
about: Acerca de
contact: Contáctenos
settings: Configuración
contact: Contáctanos
settings: Configuraciones
user:
greeting: Hola, {name}!
greeting: ¡Hola, {name}!
profile:
title: Tu Perfil
edit: Editar Perfil
save: Guardar Cambios
title: Tu perfil
edit: Editar perfil
save: Guardar cambios
cancel: Cancelar
errors:
not_found: Página no encontrada
server_error: Ocurrió un error en el servidor
validation:
required: Este campo es obligatorio
email: Por favor, introduce una dirección de correo válida
email: Por favor, introduce una dirección de correo electrónico válida
password: La contraseña debe tener al menos 8 caracteres
form:
email: Dirección de Correo Electrónico
email: Dirección de correo electrónico
password: Contraseña
submit: Enviar
reset: Restablecer Formulario
reset: Restablecer formulario
success:
saved: Cambios guardados exitosamente
uploaded: Archivo subido exitosamente
deleted: Elemento eliminado exitosamente
saved: Cambios guardados con éxito
uploaded: Archivo subido con éxito
deleted: Elemento eliminado con éxito
time:
today: Hoy
yesterday: Ayer
tomorrow: Mañana
days_ago: Hace {count} días
days_ago: "{count} días atrás"
hello: Hola
36 changes: 36 additions & 0 deletions examples/yaml/locales/fr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
welcome: Bienvenue dans notre application !
goodbye: Merci d'utiliser notre application. À la prochaine !
nav:
home: Accueil
about: À propos
contact: Contactez-nous
settings: Paramètres
user:
greeting: Bonjour, {name} !
profile:
title: Votre profil
edit: Modifier le profil
save: Enregistrer les modifications
cancel: Annuler
errors:
not_found: Page non trouvée
server_error: Une erreur s'est produite sur le serveur
validation:
required: Ce champ est requis
email: Veuillez entrer une adresse e-mail valide
password: Le mot de passe doit comporter au moins 8 caractères
form:
email: Adresse e-mail
password: Mot de passe
submit: Soumettre
reset: Réinitialiser le formulaire
success:
saved: Modifications enregistrées avec succès
uploaded: Fichier téléchargé avec succès
deleted: Élément supprimé avec succès
time:
today: Aujourd'hui
yesterday: Hier
tomorrow: Demain
days_ago: "{count} jours auparavant"
hello: Bonjour
4 changes: 2 additions & 2 deletions packages/cli/src/commands/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ type Format = typeof parserTypeSchema._type;

const SUPPORTED_FORMATS = [
{ value: "json", label: "JSON (.json)" },
{ value: "yml", label: "YAML (.yml, .yaml)" },
{ value: "yaml", label: "YAML (.yml, .yaml)" },
{ value: "properties", label: "Java Properties (.properties)" },
{ value: "android", label: "Android (.xml)" },
{ value: "xcode-strings", label: "iOS Strings (.strings)" },
Expand All @@ -39,7 +39,7 @@ const SUPPORTED_FORMATS = [

const FORMAT_EXAMPLES: Record<Format, string> = {
json: "src/locales/[locale].json",
yml: "src/locales/[locale].yaml",
yaml: "src/locales/[locale].yaml",
properties: "src/locales/messages_[locale].properties",
android: "res/values-[locale]/strings.xml",
"xcode-strings": "[locale].lproj/Localizable.strings",
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/src/parsers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const parserTypeSchema = z.enum([
"ts",
"json",
"po",
"yml",
"yaml",
"xml",
"xliff",
"xcode-strings",
Expand Down Expand Up @@ -74,7 +74,7 @@ export function createParser(options: CreateParserOptions): Parser {
return createXliffParser();
case "xml":
return createXmlParser();
case "yml":
case "yaml":
return createYamlParser();
default:
throw new Error(`Unsupported parser type: ${options.type}`);
Expand Down

0 comments on commit 02dd4f1

Please sign in to comment.