Conversión de archivos .strings a archivos .strings.json
Organiza tus páginas con colecciones
Guarda y categoriza el contenido según tus preferencias.
Para convertir un archivo .strings en un archivo .strings.json, haz lo siguiente:
Si usas una versión de Looker anterior a la 7.12, desactiva la función heredada Archivos .strings heredados para la localización.
Para crear un nuevo archivo .strings.json para tu proyecto, haz clic en el ícono + en la parte superior derecha de la lista de archivos del proyecto y selecciona Create Locale Strings File.
Asigna un nombre a tu nuevo archivo .strings.json. Los títulos de los archivos .strings deben coincidir con el código de configuración regional asignado a los usuarios o grupos que usan esa configuración regional, y el título del archivo de configuración regional predeterminado debe coincidir con el valor de default_locale en el archivo de manifiesto de tu proyecto.
El fragmento que aparece en el nuevo archivo .strings.json proporciona un ejemplo de formato JSON. Borra este ejemplo y reemplázalo por un par de llaves: {}
Copia los pares clave-valor de tu archivo .strings anterior y pégalos dentro de las llaves.
Reemplaza todos los signos iguales por dos puntos.
Quita los comentarios o refórmalos como comentarios individuales o como un array de comentarios, como se muestra a continuación.
Reemplaza todos los puntos y comas por comas.
El formato .strings.json típico de los pares clave-valor se ve de la siguiente manera:
Para dar formato a los comentarios, puedes usar los siguientes formatos:
{
" My Comment": {
"my_comment_array": [
"The name of this file should be the associated locale code followed by '.strings.json'",
"There is one .strings.json file per locale.",
"Define your translated strings one key at a time",
"Keys can be any string; choose whatever scheme helps you stay organized",
"Then, set your Lookml label and description parameters to the desired key values.",
"To choose this file as the master key list and as the one to validate against",
"set its locale code ('test') as the default_locale in the manifest file"
],
"value": "Translation for My Comment"
},
"My Key": {
"value": "Translation for My Key",
"comment": "Define your translated strings with a comment or an array of comments"
}
}
[[["Fácil de comprender","easyToUnderstand","thumb-up"],["Resolvió mi problema","solvedMyProblem","thumb-up"],["Otro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Información o código de muestra incorrectos","incorrectInformationOrSampleCode","thumb-down"],["Faltan la información o los ejemplos que necesito","missingTheInformationSamplesINeed","thumb-down"],["Problema de traducción","translationIssue","thumb-down"],["Otro","otherDown","thumb-down"]],["Última actualización: 2025-07-31 (UTC)"],[],[],null,["# Converting .strings files to .strings.json files\n\nTo convert a `.strings` file to a `.strings.json` file:\n\n1. If you're using a Looker version prior to 7.12, turn off the **Legacy .strings files for localization** legacy feature.\n2. Create a new `.strings.json` file for your project by clicking the **+** icon at the top right of your project file list and selecting **Create Locale Strings File**.\n3. Name your new `.strings.json` file. The titles of `.strings` files must [match the locale code](/looker/docs/model-localization#assigning_users_to_a_locale) assigned to users or groups who are using that locale, and the title of the default locale file must match the value for the `default_locale` in your project's [manifest file](/looker/docs/model-localization#manifest).\n4. The snippet that appears in the new `.strings.json` file provides an example of JSON formatting. Delete this example and replace it with a pair of curly braces: `{}`\n5. Copy the key-value pairs from your old `.strings` file and paste them inside the curly braces.\n6. Replace all the equal signs with colons.\n7. Remove any comments; or reformat them as individual comments or as an array of comments, as illustrated next.\n8. Replace all the semicolons with commas.\n\n\nTypical `.strings.json` formatting of the key-value pairs looks like this: \n\n```\n{\n \"flight_info\" : \"Flight Info\",\n \"id\" : \"Identifier\",\n \"airline\" : \"Air Carrier\"\n}\n```\n\n\nTo format comments, you can use these formats: \n\n```\n{\n \" My Comment\": {\n \"my_comment_array\": [\n \"The name of this file should be the associated locale code followed by '.strings.json'\",\n \"There is one .strings.json file per locale.\",\n \"Define your translated strings one key at a time\",\n \"Keys can be any string; choose whatever scheme helps you stay organized\",\n \"Then, set your Lookml label and description parameters to the desired key values.\",\n \"To choose this file as the master key list and as the one to validate against\",\n \"set its locale code ('test') as the default_locale in the manifest file\"\n ],\n \"value\": \"Translation for My Comment\"\n },\n \"My Key\": {\n \"value\": \"Translation for My Key\",\n \"comment\": \"Define your translated strings with a comment or an array of comments\"\n }\n}\n```"]]