Updated 035 Translation Mananger in JCB explained (markdown)
parent
dc0567b597
commit
dd1e11c80d
@ -23,13 +23,17 @@ If those values are entered in the XML field definition area, JCB on the fly wil
|
||||
[00:02:43](https://www.youtube.com/watch?v=zzAcVkn_cWU&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h02m43s)
|
||||
|
||||
There had been a request that if it were possible, to translate this language strings, and then when JCB compiles the component, it will automatically add these other languages.
|
||||
It had been suggested that an area should be added where as many languages as preferred can be created in accordance with the conventions.<<<<<<<<
|
||||
It had been suggested that an area should be added where as many languages as preferred can be created in accordance with the conventions.[00:03:10](https://www.youtube.com/watch?v=zzAcVkn_cWU&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h03m10s)
|
||||
|
||||
[00:03:10](https://www.youtube.com/watch?v=zzAcVkn_cWU&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h03m10s) Your language tags need to be in in accordance with the correct prefixes used in Joomla. So I think we could add a link here. Maybe on this page at some point just to take you somewhere where you can find all the information to use the correct tagging for your language file. And here(Name) you could add the language name, you can create as many languages as you like. [00:03:39](https://www.youtube.com/watch?v=zzAcVkn_cWU&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h03m39s) Then when you compile a component, JCB, like I have explained, grabs all the strings from everywhere, and adds them to the British English translation file.
|
||||
Your language tags need to be in accordance with the correct prefixes used in Joomla. Maybe a link can be added on this page at some point just to take you somewhere, where you can find all the information to use the correct tagging for your language file. Here('Name'), you could add the language name, and may create as many languages as you prefer. [00:03:39](https://www.youtube.com/watch?v=zzAcVkn_cWU&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h03m39s) When a component is compiled, JCB, as explained, grabs all the strings from everywhere, and adds them to the British English translation file.
|
||||
|
||||
### Code - Language String
|
||||
|
||||
Let me show you some of what is happening in the code. In the a_Get.php class, we have a function called setLangStrings. [00:04:07](https://www.youtube.com/watch?v=zzAcVkn_cWU&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h04m07s) It gets the content from wherever JCB is handing it and it parses it to see whether it has either this(sprintf) language string or that one(Jtext). Then it does some gymnastics here to grab all the actual strings into an array. Then it parses this array. Once it has it, and it converts it to a language string, and it adds it back [00:04:34](https://www.youtube.com/watch?v=zzAcVkn_cWU&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h04m34s) into the content and returns the content. With this, we call it an object array, it is adding the language string, and the language key to the langContent array. So that's a first thing we have this langContent array. It's all over the place and it just gets bulkier and bulkier. Now the lang is basically the target. [00:05:04](https://www.youtube.com/watch?v=zzAcVkn_cWU&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h05m04s) It's the area which this lang strings belong to either the site or the site system or the admin or the admin system area. There are also such a thing as both while JCB compiles. Some strings he knows must go to both. And this(keyLang) is the actual language string be capitalized string, which is generated up here(see video). [00:05:34](https://www.youtube.com/watch?v=zzAcVkn_cWU&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h05m34s) I trimmed and placed in it's place. This array gets placed into the files at a certain point. That point is very much at the very end of the compilation when everything is being done. We actually get to the place where [00:05:58](https://www.youtube.com/watch?v=zzAcVkn_cWU&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h05m58s) we going to add two strings to the files.
|
||||
[00:03:50](https://www.youtube.com/watch?v=zzAcVkn_cWU&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h03m50s)
|
||||
|
||||
In the code the following takes place. In the 'a_Get.php' class, is a function called 'setLangStrings'. It gets the content from wherever JCB is handing it and it parses it to see whether it has either this'sprintf' language string or that one'Jtext'. It does some gymnastics to grab all the actual strings into an array. Then it parses this array. Once it has it, it converts it to a language string, and adds it back into the content and returns the content.[00:04:34](https://www.youtube.com/watch?v=zzAcVkn_cWU&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h04m34s) With this object array, it is adding the language string, and the language key to the 'langContent' array. So that is a first thing, this 'langContent' array which is all over the place and it just gets bulkier. The 'lang' is basically the target. [00:05:04](https://www.youtube.com/watch?v=zzAcVkn_cWU&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h05m04s) It is the area which this 'lang' strings belong to, either the Site or the Site system or the Admin or the Admin system area. There are also such a thing as both while JCB compiles. Some strings, it knows must go to both. This 'keyLang' is the actual language string, the capitalized string, which is generated up here(see video).<<<<<,
|
||||
|
||||
[00:05:34](https://www.youtube.com/watch?v=zzAcVkn_cWU&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h05m34s) I trimmed and placed in it's place. This array gets placed into the files at a certain point. That point is very much at the very end of the compilation when everything is being done. We actually get to the place where [00:05:58](https://www.youtube.com/watch?v=zzAcVkn_cWU&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h05m58s) we going to add two strings to the files.
|
||||
|
||||
### Adding Strings To The Files
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user