Where is a language string located

Where is a language string located

by Keith Bryant -
Number of replies: 12

I've checked the language FAQ and found the Q and A to "How can I find where a language string is located?" I followed the instructions and checked the relevant checkbox in Debugging, returned to a course page, added ?strings=1 to the end of the URL and reloaded, as instructed.  Nothing had changed and I couldn't see any information on the language string.

Have I missed something?    (It's very likely as my skills are more in teaching than in the technical stuff!)

Thanks for any help

Keith

Average of ratings: -
In reply to Keith Bryant

Re: Where is a language string located

by Mary Cooch -
Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators

Which particular string are you looking for?

In reply to Mary Cooch

Re: Where is a language string located

by Keith Bryant -

No particular string just now.  I can find the strings I need to modify via the "Language Customisation" under "Site Admin". But when I saw there was maybe a way to find a particular string from a particular page I got excited about that.

Recently I wanted to modify the Swedish version.  The button was "Next" in English, "Nästa" in Swedish, and in just that particular situation the Swedish word term "Fortsätta" was better.

I searched the whole language pack for "nästa" and as you can imagine I got a lot of hits. In most of them the use of "nästa" was correct and it took a while to search through them all and change just the ones I needed to change.

I thought the string=1 (or ?string=1) could speed up the process by allowing me to find the exact string directly.  But so far I haven't got it to work. sad

(Thanks for a very quick response!)

In reply to Keith Bryant

Re: Where is a language string located

by David Mudrák -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Plugins guardians Picture of Testers Picture of Translators

It must be plural ?strings=1

Attachment debugstrings.png
Average of ratings: Useful (2)
In reply to David Mudrák

Re: Where is a language string located

by Keith Bryant -

Brilliant - Thanks David.

In the instructions in Moodle under - Site Admin, Development, Debugging - the ? mark is missing.

This option is designed to help translators. When this option is enabled, if you add the parameter strings=1 to a request URL, it will show the language file and string id beside each string that is output.

In reply to Keith Bryant

Re: Where is a language string located

by David Mudrák -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Plugins guardians Picture of Testers Picture of Translators

Well, it's not that easy. The question mark is not always there, you may need to add &strings=1 in certain situations, Pages like this provide more details.

Average of ratings: Useful (4)
In reply to David Mudrák

Re: Where is a language string located

by Helen Foster -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Thanks David for the information which I've made a note of in the documentation Debugging. Anyone please feel free to add to or amend the information. smile

In reply to Helen Foster

Re: Where is a language string located

by Keith Bryant -

Thanks for updating the debugging documentation Helen.

Could you do the same for the Language FAQ, found here...

https://docs.moodle.org/27/en/Language_FAQ#How_can_I_find_where_a_language_string_is_located.3F

Regards

Keith

In reply to Keith Bryant

Re: Where is a language string located

by Helen Foster -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Thanks Keith, I have amended Language FAQ. Feel free to do so yourself next time. wink You can log in to Moodle Docs with your moodle.org username and password.

Average of ratings: Useful (1)
In reply to Helen Foster

Re: Where is a language string located

by Keith Bryant -

Thanks Helen, both for the amendment and the info that I can change these things myself.  I didn't realise that!

I practiced by amending the Language FAQ in the 2.6 information, which is the one Mid Sweden University are using at the moment.  Now I'll move on and amend the 2.6 debugging text in the same way!  Learning by doing!!

In reply to Keith Bryant

Re: Where is a language string located

by Helen Foster -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Thanks a lot Keith for your contributions to the 2.6 documentation. Please feel free to do as I do and make a note in the docs of anything new that you learn about Moodle. smile

In reply to David Mudrák

Re: Where is a language string located

by Keith Bryant -

Ok, with that last bit of extra information (?strings=1 or &strings=1 ) I seem to have it working on every page I visit.  Thanks for the link to the wikipedia page too.

Thanks again.

Keith

In reply to Keith Bryant

Re: Where is a language string located

by Leandro Barbosa Rodrigues -

If you are using a server linux, you can find by terminal administrstion, editing directly on php application file.

First search the sentence using this command

Langdir of moodle application directory 

Sebtence who you need to change 

# find /langdir | xargs grep -s -a -i sentence | cut -d : -f 1 | uniq 

The results are the files wich has the sentence, just edit then

!! Be careful!!  Its for advanced users