Diferencia entre revisiones de «29/Personalización del idioma»

De MoodleDocs
m (tidy up)
m (tidy up)
Línea 87: Línea 87:
==Vea también==
==Vea también==
* [[Personalización del idioma decsep|Cómo personalizar]] el [[Separador decimal]] para cambiar el coma decimal a punto decimal o viceversa.
* [[Personalización del idioma decsep|Cómo personalizar]] el [[Separador decimal]] para cambiar el coma decimal a punto decimal o viceversa.
* [[Personalización_del_idioma_(transplantar_archivos)]] acerca de cómo suplementar un servidor que emplea Español internacional con traducciones que solamente existen en el [[Español de México]]
* [[Personalización_del_idioma_(transplantar_archivos)]] acerca de cómo suplementar un servidor que emplea [[Español internacional]] con traducciones que solamente existen en el [[Español de México]]
* [[Personalización_del_idioma_(cambiar_nombredeusuario)]] acerca de cómo cambiar la expresión 'nombredeusuario' del [[Español de México]]  
* [[Personalización_del_idioma_(cambiar_nombredeusuario)]] acerca de cómo cambiar la expresión 'nombredeusuario' del [[Español de México]]  
* Discusión en el foro [https://moodle.org/mod/forum/discuss.php?d=219504 Duplicate entry 'en-373-AM'] acerca del error al intentar editar un paquete de idioma
* Discusión en el foro [https://moodle.org/mod/forum/discuss.php?d=219504 Duplicate entry 'en-373-AM'] acerca del error al intentar editar un paquete de idioma

Revisión del 15:16 30 mar 2013


Moodle 2.x

Las palabras o frases (en cualquier idioma) usadas en el sitio pueden ser cambiadas fácilmente por un administrador empleando la característica de personalización del idioma. Por ejemplo, usted podría querer cambiar la palabra "Curso" por "Unidad de aprendizaje". El proceso consta de 4 pasos:

  1. Abrir el paquete de idioma para editarlo
  2. Filtrar las cadenas de texto que quiere personalizar
  3. Personalizar las cadenas de texto
  4. Guardar los cambios en el paquete de idioma

Instrucciones rápidas para el impaciente

  1. Vaya a la página de Configuraciones > Administración del sitio > Idioma> Personalización del idioma.
  2. Seleccione el idioma a personalizar de la lista desplegable.
  3. Elija el botón "Abrir el paquete de idioma para editarlo". Esto puede tomar un buen tiempo en procesarse.
  4. Haga Click o Ctrl+Click para seleccionar uno o más archivos en la interfase de "Mostrar cadenas de estos componentes". Observe que los archivos están agrupados. Por ejemplo, usted encontrará las cadenas de texto relacionadas con lección (archivo lesson.php en la parte de mod (módulos); mientras que moodle.php está inmediatamente debajo de core (núcleo).
  5. Después de seleccinar el/los archivo(s), es posible emplear el filtro de "Solamente cadenas con" o algún otro filtro. Por ejemplo, usted puede buscar sólamente cadenas de texto que contengan la palabra "teacher" (maestro).
  6. Elija "Guardar los cambios y continuar editando" si desea seguir buscando en otro archivo PHP o elegir otra cadena de caracteres.
  7. Elija "Guardar los cambios en el paquete de idioma" para guardar todos los cambios que haya hecho.
Tip: ¿No ve ningún cambio en el texto? ¿Se acordó de oprimir el botón para "Guardar los cambios en el paquete de idioma"? ¿Refrescó (F5) su navegador? ¿Realmente edito el archivo correcto que es empleado en su sitio, curso o por el usuario?
Tip: ¿No puede encontrar la cadena que desea cambiar? Active la casilla de 'Mostrar el orígen de cadenas de idioma' en Configuraciones > Administración del sitio > Desarrollo > Depurando (Debugging) y luego visite la página que contiene el texto que desea personalizar.

Introducción

Moodle is translated into many languages - see Moodle.org: Language packs for their list and the translation completion status. The translations are distributed in so called language packages (or just lang packs) that are maintained by kind volunteers, community contributors and Moodle partners. Please read the page Translation first to understand how the whole localization machinery works.

Moodle site administrators can customize any language pack to fit their individual needs (for example to use the term "Unit" instead of "Course"). You are discouraged from direct editing the files coming as a part official language pack. Such changes would be silently overwritten during the next upgrade. Instead, you should create a local language pack that holds all your changes from the official pack.

Local language packs have the same structure as the official ones. They are saved in your Moodle data directory in moodledata/lang/xx_local/ folder where 'xx' is the code of the language. You have to have the official language pack installed before you can customize it. Local language pack should contain just strings you have customized - you should not copy whole official language packs.

When displaying a string, Moodle first looks if a local customization of it exists in moodledata/lang/xx_local/component_file.php. If so, it is used. If not, the string from the official language pack is used (eventually, if the string has not been translated yet, the original English version is displayed). Please note that the strings are cached for better performance so you have to purge Moodle caches after you modify a file in your xx_local pack (caches are purged automatically if you use the tool described below).

Usando la herramienta para personalización del idioma

Moodle comes with a tool that allows you to edit your local language pack via web interface. This tool is available for the site administrators in Settings > Site administration > Language > Language customization. Please refer to the following workflow diagram.

Workflow of the language customization (click to enlarge)


Poner las cadenas en el traductor

At the Language customization first page, select a language to customize and press the button 'Check out string into translator'. During the checkout, Moodle loads the language strings from PHP files into its database. The language customization tool works with this database so the files in your xx_local pack are not touched unless your proceed to the final step of this workflow. If the xx_local language pack does not exist yet, Moodle automatically creates an empty one for you.

Tip: There is currently a problem with "execution time". If you get the "Fatal error: Maximum execution time of 180 seconds exceeded" message, you will have to press the button 'Check out string into translator' several times to get the operation completed. See forum discussion.

Use el filtro para encontrar la cadena de caracteres que desea personalizar

Moodle 2.0 language filter

After the checkout, use the "filter strings" form to find strings you want to customize for your site. Not selecting any filters will display all strings in the language pack.

  • Show strings of these components - Click or Ctrl+click to select one or more files that contain the string you want.
  • Customized only - check this field to display only those strings that are already present in your xx_local pack.
  • Help only' - check this field to display only help tooltips, that is the texts used when clicking the yellow question mark icon.
Note: Starting in Moodle 2.0, help string identifiers must end with _help suffix.
  • Modified only - displays only the strings that are modified in the current session.
Note: The term 'customized' means strings that are saved on disk in your xx_local pack directory. The term 'modified' represents the changes made since the last checkin string into the language pack. Customized strings (already saved in a file) are highlighted with green. Modified strings (not saved in a file yet) are highlighted with blue.
Tip: You may want to use this option look at your current work before you check it in.
  • Only strings containing - insert a phrase that must appear in the string. For example, if you put a word 'student' here, you will get only those strings that contain this word.
Tip: The 'Only strings' filter can be used for a total search for a term used in your Moodle site for the selected language pack.
  • String identifier - if you know the string identifier (it is the first parameter of the get_string() function), type it here. For example, the names of activity modules are defined in strings 'modulename'. Finding where a particular string is saved can be difficult sometimes. The administrator can start a debugging function: Site administration>Development>Debugging and choose "Show origin of language strings". Then if you append "?strings=1" (or "&strings=1" if there is already a parameter) to the end of the page URL, beside each string will be shown something like "{rememberusername/admin}". The last part says which php file uses the string, so this one is in admin.php. If there is nothing after the / look in moodle.php. The first part, before the /, is the string identifier.

Use combination of filter settings to get the required set of strings.

Click button 'Show strings' for potential editing.

Escriba su propia traducción

The strings that pass all the conditions defined in the filter are displayed in a table. To replace the standard translation, put your own into the 'Local customization' field.

Tip:If you want to delete your current customization , just delete the content of the 'Local customization' field and click the "Save and continue editing". The modifications that are going to be removed a customized string are highlighted in red. If you made changes to a field previously "Save and continue editing" it will be highlighted in blue.

Elija el botón"Aplicar cambios y continuar editando" antes de cambiar las configuraciones del filtro y mostrar un nuevo conjunto de cadenas.

Guarde su trabajo a los archivos

As necessary, you may repeat the "show strings", "local customization" and "Save and continue" process. When you have made all the changes you want to make:

Elija "Guardar los cambios en el paquete de idioma" para procesar todos los cambios hechos en la base de datos del traductor hacia su paquete de idioma local.

Escribiendo las modificaciones a los archivos

Al abrir el paquete de idioma para editarlo, los contenidos de la base de datos del traductor se vuelcan hacia archivos en el directorio moodledata/lang/xx_local/ directory.

Elija "Guardar los cambios en el paquete de idioma" para procesar todos los cambios hechos a su paquete de idioma local.

Nota: esta operación remueve el directorio primero y luego lo re-crea con los datos actuales. Por elllo es razonable no manipular directamente los archivos después de haberlos guardado en el traductor.

Vea también