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

Add support for more file formats #16

Merged
merged 5 commits into from
Dec 26, 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
49 changes: 49 additions & 0 deletions apps/web/src/components/commands.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,55 @@ export function Commands() {
>
│ ○ Markdown (.md)
</span>
<span
className={cn(
"transition-opacity duration-100",
step >= 4 ? "opacity-100" : "opacity-0",
)}
>
│ ○ Xcode Strings (.strings)
</span>
<span
className={cn(
"transition-opacity duration-100",
step >= 4 ? "opacity-100" : "opacity-0",
)}
>
│ ○ Xcode Stringsdict (.stringsdict)
</span>
<span
className={cn(
"transition-opacity duration-100",
step >= 4 ? "opacity-100" : "opacity-0",
)}
>
│ ○ Xcode XCStrings (.xcstrings)
</span>
<span
className={cn(
"transition-opacity duration-100",
step >= 4 ? "opacity-100" : "opacity-0",
)}
>
│ ○ YAML (.yml)
</span>
<span
className={cn(
"transition-opacity duration-100",
step >= 4 ? "opacity-100" : "opacity-0",
)}
>
│ ○ Gettext (.po)
</span>
<span
className={cn(
"transition-opacity duration-100",
step >= 4 ? "opacity-100" : "opacity-0",
)}
>
│ ○ Android (.xml)
</span>

<span
className={cn(
"transition-opacity duration-100",
Expand Down
Binary file modified bun.lockb
Binary file not shown.
16 changes: 16 additions & 0 deletions examples/android/languine.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
export default {
version: "0.6.2",
locale: {
source: "en",
targets: ["es"],
},
files: {
android: {
include: ["locales/[locale].xml"],
},
},
llm: {
provider: "openai",
model: "gpt-4-turbo",
},
};
68 changes: 68 additions & 0 deletions examples/android/locales/en.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Navigation -->
<string name="nav_home">Home</string>
<string name="nav_search">Search</string>
<string name="nav_favorites">Favorites</string>
<string name="nav_settings">Settings</string>

<!-- User Profile -->
<string name="profile_title">My Profile</string>
<string name="profile_edit">Edit Profile</string>
<string name="profile_save">Save Changes</string>
<string name="profile_logout">Sign Out</string>

<!-- Media Player -->
<plurals name="media_queue">
<item quantity="one">%d song in queue</item>
<item quantity="other">%d songs in queue</item>
</plurals>
<string name="media_play">Play</string>
<string name="media_pause">Pause</string>
<string name="media_next">Next Track</string>
<string name="media_previous">Previous Track</string>

<!-- Shopping Cart -->
<string name="cart_title">Shopping Cart</string>
<string name="cart_total">Total: $%1$.2f</string>
<string name="cart_checkout">Proceed to Checkout</string>
<string-array name="payment_methods">
<item>Credit Card</item>
<item>PayPal</item>
<item>Bank Transfer</item>
</string-array>

<!-- Weather -->
<string name="weather_current">Current Temperature: %1$d°</string>
<string name="weather_humidity">Humidity: %1$d%%</string>
<string name="weather_wind">Wind Speed: %1$d mph</string>

<!-- Notifications -->
<string name="notification_new_message">%1$s sent you a message</string>
<string name="notification_friend_request">New friend request from %1$s</string>
<plurals name="notification_likes">
<item quantity="one">%d person liked your post</item>
<item quantity="other">%d people liked your post</item>
</plurals>

<!-- Error Messages -->
<string name="error_network">Unable to connect to network</string>
<string name="error_timeout">Request timed out</string>
<string name="error_invalid_input">Invalid input provided</string>

<!-- Calendar -->
<string name="calendar_event_title">Event: %1$s</string>
<string name="calendar_event_time">Time: %1$s - %2$s</string>
<string name="calendar_event_location">Location: %1$s</string>

<!-- Game -->
<string name="game_score">Score: %1$d</string>
<string name="game_high_score">High Score: %1$d</string>
<string name="game_lives_left">Lives: %1$d</string>
<plurals name="game_achievements">
<item quantity="one">%d achievement unlocked</item>
<item quantity="other">%d achievements unlocked</item>
</plurals>

<string name="welcome_message">Welcome to our application!</string>
</resources>
52 changes: 52 additions & 0 deletions examples/android/locales/es.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<resources>
<string name="nav_home">Inicio</string>
<string name="nav_search">Buscar</string>
<string name="nav_favorites">Favoritos</string>
<string name="nav_settings">Configuración</string>
<string name="profile_title">Mi Perfil</string>
<string name="profile_edit">Editar Perfil</string>
<string name="profile_save">Guardar Cambios</string>
<string name="profile_logout">Cerrar Sesión</string>
<string name="media_play">Reproducir</string>
<string name="media_pause">Pausa</string>
<string name="media_next">Siguiente Canción</string>
<string name="media_previous">Canción Anterior</string>
<string name="cart_title">Carrito de Compras</string>
<string name="cart_total">Total: $%1$.2f</string>
<string name="cart_checkout">Proceder al Pago</string>
<string name="weather_current">Temperatura Actual: %1$d°</string>
<string name="weather_humidity">Humedad: %1$d%%</string>
<string name="weather_wind">Velocidad del Viento: %1$d mph</string>
<string name="notification_new_message">%1$s te ha enviado un mensaje</string>
<string name="notification_friend_request">Nueva solicitud de amistad de %1$s</string>
<string name="error_network">No se puede conectar a la red</string>
<string name="error_timeout">Tiempo de solicitud agotado</string>
<string name="error_invalid_input">Entrada inválida proporcionada</string>
<string name="calendar_event_title">Evento: %1$s</string>
<string name="calendar_event_time">Hora: %1$s - %2$s</string>
<string name="calendar_event_location">Ubicación: %1$s</string>
<string name="game_score">Puntuación: %1$d</string>
<string name="game_high_score">Puntuación Más Alta: %1$d</string>
<string name="game_lives_left">Vidas: %1$d</string>
<string name="welcome_message">¡Bienvenido a nuestra aplicación!</string>
<string-array name="payment_methods">
<item>Tarjeta de Crédito</item>
<item>PayPal</item>
<item>Transferencia Bancaria</item>
</string-array>
<plurals name="media_queue">
<item quantity="one">%d canción en cola</item>
<item quantity="other">%d canciones en cola</item>
</plurals>
<plurals name="notification_likes">
<item quantity="one">%d persona le gustó tu publicación</item>
<item quantity="other">%d personas les gustó tu publicación</item>
</plurals>
<plurals name="game_achievements">
<item quantity="one">%d logro desbloqueado</item>
<item quantity="other">%d logros desbloqueados</item>
</plurals>
</resources>
</resources>
3 changes: 2 additions & 1 deletion examples/i18next/languine.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ export default {
include: ["locales/[locale].json"],
},
},
openai: {
llm: {
provider: "openai",
model: "gpt-4-turbo",
},
};
2 changes: 1 addition & 1 deletion examples/i18next/locales/sv.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
"interpolated": "Ha en trevlig dag, {{name}}!",
"pluralKey_one": "Det här är ett fint exempel.",
"pluralKey_other": "Det här är fina exempel."
}
}
3 changes: 2 additions & 1 deletion examples/lingui/languine.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ export default {
include: ["locales/[locale].json"],
},
},
openai: {
llm: {
provider: "openai",
model: "gpt-4-turbo",
},
hooks: {
Expand Down
3 changes: 2 additions & 1 deletion examples/next-intl/languine.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ export default {
include: ["messages/[locale].json"],
},
},
openai: {
llm: {
provider: "openai",
model: "gpt-4-turbo",
},
};
16 changes: 16 additions & 0 deletions examples/po/languine.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
export default {
version: "0.6.2",
locale: {
source: "en",
targets: ["es"],
},
files: {
po: {
include: ["locales/[locale].po"],
},
},
llm: {
provider: "openai",
model: "gpt-4-turbo",
},
};
7 changes: 7 additions & 0 deletions examples/po/locales/en.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# This is a PO file containing English strings that serve as the source for translations.
# Each entry consists of a msgid (string identifier) and msgstr (translated string).
msgid "welcome_message"
msgstr "Welcome to our application!"

msgid "error_message"
msgstr "An error occurred: {error_code}"
7 changes: 7 additions & 0 deletions examples/po/locales/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# This is a PO file containing English strings that serve as the source for translations.
# Each entry consists of a msgid (string identifier) and msgstr (translated string).
msgid "welcome_message"
msgstr "Bienvenido a nuestra aplicación!"

msgid "error_message"
msgstr "Se produjo un error: {error_code}"
20 changes: 20 additions & 0 deletions examples/xcode-strings/Example/en.lproj/Localizable.strings
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
"welcome_message" = "Welcome to Weather App!";
"temperature_format" = "%1$.1f°%2$@";
"wind_speed" = "Wind: %1$.1f %2$@";
"forecast_daily" = "Daily forecast for %@";
"notification_body" = "Storm alert for %1$@ region\nWind speeds up to %2$d mph expected";

"battery_empty" = "Battery depleted";
"battery_low" = "Battery at %d%% - please charge soon";
"battery_full" = "Battery fully charged";

"photo_count_zero" = "No photos";
"photo_count_one" = "%d photo";
"photo_count_other" = "%d photos";

"time_remaining_now" = "Download complete!";
"time_remaining_minutes" = "%d minutes remaining";
"time_remaining_hours" = "About %d hours remaining";

"share_message" = "Check out this photo I took with %1$@!\nLocation: %2$@\nTime: %3$@";
"rich_notification" = "New message from %@:\n<b>%@</b>\n<a href=\"%@\">View details</a>";
16 changes: 16 additions & 0 deletions examples/xcode-strings/Example/es.lproj/Localizable.strings
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
"welcome_message" = "¡Bienvenido a Weather App!";
"temperature_format" = "%1$.1f°%2$@";
"wind_speed" = "Viento: %1$.1f %2$@";
"forecast_daily" = "Pronóstico diario para %@";
"notification_body" = "Alerta de tormenta para la región de %1$@\nSe esperan velocidades de viento de hasta %2$d mph";
"battery_empty" = "Batería agotada";
"battery_low" = "Batería al %d%% - por favor carga pronto";
"battery_full" = "Batería completamente cargada";
"photo_count_zero" = "No hay fotos";
"photo_count_one" = "%d foto";
"photo_count_other" = "%d fotos";
"time_remaining_now" = "¡Descarga completa!";
"time_remaining_minutes" = "%d minutos restantes";
"time_remaining_hours" = "Aproximadamente %d horas restantes";
"share_message" = "Mira esta foto que tomé con %1$@!\nUbicación: %2$@\nHora: %3$@";
"rich_notification" = "Nuevo mensaje de %@:\n<b>%@</b>\n<a href=\"%@\">Ver detalles</a>";
16 changes: 16 additions & 0 deletions examples/xcode-strings/languine.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
export default {
version: "0.6.2",
locale: {
source: "en",
targets: ["es"],
},
files: {
"xcode-strings": {
include: ["Example/[locale].lproj/Localizable.strings"],
},
},
llm: {
provider: "openai",
model: "gpt-4-turbo",
},
};
Loading
Loading