How many strings are in a language or a customize

How many strings are in a language or a customize

par Jesús Basco Lopez,
Nombre de réponses : 4

I need to know how many strings are in our moodle in:

  • English
  • Spanish.
  • Our customize strings.

Thanks in advance

Moyenne des évaluations  -
En réponse à Jesús Basco Lopez

Re: How many strings are in a language or a customize

par Ralf Hilgenstock,
Avatar Core developers Avatar Particularly helpful Moodlers Avatar Translators
You can count it in lang.moodle.org.
Spanish 29.000 (Moodle standard plugins)
137.000 Spanish (with all 3rd party plugins)
En réponse à Jesús Basco Lopez

Re: How many strings are in a language or a customize

par Randy Thornton,
Avatar Documentation writers

Jesús,

You can find the list of customized strings for any language pack in the Language customization tool. For the filters, choose all the components, then check the box for "Customised only" and click the "Show strings" button. This will list them all.

If you have a lot of strings and several languages, and would like to get the totals, you can do this at the command line.

Customized strings are stored in /moodledata/lang/xx_local, where xx is the language code. So, lang/en_local or lang/es_local, etc. There will be a php file for each of the components you have customized which has one line that starts with $string for each string you have customized. Counting these lines in each php file will give you the total customizations for each language.

If you are on Linux, you can use grep to do this. For example, to see how many customizations I have made to the core English (en) pack, I usually use this command:

$ grep -ro '^\$string\[' /moodledata/lang/en_local/* | wc -l
This shows the total number. If you leave off the final part ( |  wc -l ), it will show you the actual lines instead. You can repeat this for all the languages you have.

Randy



Annexe screenshot_8852.jpg
Moyenne des évaluations Useful (2)
En réponse à Randy Thornton

Re: How many strings are in a language or a customize

par Randy Thornton,
Avatar Documentation writers
Also, new in Moodle 3.10 is the ability to import and export your custom strings.

The export is a zip file containing each of the php lanugage files as a whole. So, no more having to root around on the server to get them for safekeeping.

https://tracker.moodle.org/browse/MDL-69582
https://tracker.moodle.org/browse/MDL-69583

This should help you to know exactly what you have customized and allow you to edit them offline and then import them back into Moodle.


Annexe screenshot_8883.jpg
Moyenne des évaluations Useful (1)