How many strings are in a language or a customize

How many strings are in a language or a customize

by Jesús Basco Lopez -
Number of replies: 4

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

  • English
  • Spanish.
  • Our customize strings.

Thanks in advance

Average of ratings: -
In reply to Jesús Basco Lopez

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

by Séverin Terrier -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators
Why do you need it? What do you really want to know/achieve/do with it?
In reply to Jesús Basco Lopez

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

by Ralf Hilgenstock -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Translators
You can count it in lang.moodle.org.
Spanish 29.000 (Moodle standard plugins)
137.000 Spanish (with all 3rd party plugins)
In reply to Jesús Basco Lopez

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

by Randy Thornton -
Picture of 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



Attachment screenshot_8852.jpg
Average of ratings: Useful (2)
In reply to Randy Thornton

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

by Randy Thornton -
Picture of 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.


Attachment screenshot_8883.jpg
Average of ratings: Useful (1)