adding to skin language

blindmime
@blindmime
7 years ago
772 posts
How do I add language strings to a skin?
updated by @blindmime: 05/15/17 12:16:31AM
blindmime
@blindmime
7 years ago
772 posts
I guess I'm missing where do I ADD a language string in my skin. Not how do I duplicate and create another language. How do I add, say, an about us section as a language string. Or, in jrElastic2 the unordered list in index.top is comprised of 6 language strings. What if I want a 7th?
michael
@michael
7 years ago
7,744 posts
I thought there was a form box for this added, but am not seeing it. hmmmmm.

One way you can do it is to clone your skin, then add the strings you want to the language file and run the integrity check.

Since its quite likely that the skin it was cloned from is going to get language updates I'd leave some space for them to come in if you want to keep in sync.

Currently the language file for elastic is found here:
/skins/jrElastic/lang/en-US.php
and looks like this:
....
$lang[55] = 'System Updates';
$lang[56] = 'Skin Images';
$lang[57] = 'Skin Style';
$lang[58] = 'Cart';
$lang[59] = 'Images';
$lang[60] = 'Location';
$lang[61] = 'Groups';
$lang[62] = 'Discussions';
add your language strings to the end of that
....
$lang[55] = 'System Updates';
$lang[56] = 'Skin Images';
$lang[57] = 'Skin Style';
$lang[58] = 'Cart';
$lang[59] = 'Images';
$lang[60] = 'Location';
$lang[61] = 'Groups';
$lang[62] = 'Discussions';
$lang[1000] = 'junk test';
$lang[1002] = 'another thing';
blindmime
@blindmime
7 years ago
772 posts
There is a note in that file:

// DO NOT EDIT THIS FILE. THIS FILE IS ONLY LOADED DURING INSTALLATION.
// ANY CHANGES TO LANGUAGE STRINGS SHOULD BE DONE IN THE CONTROL PANEL!
Melih
Melih
@melih
7 years ago
198 posts
Because after update your language files will be left in old version's directory. You need to recover your language file (simple move your file to new verison's lang directory). But in your case you need to check the the new file in every update to see if there is new lines added or not.

There is an another option:
If you have a custom module, you can add your lines to your module's language file and you can use it wherever you want. There will be no update issue because this is your own custom module.
updated by @melih: 02/06/17 03:00:18AM
SteveX
SteveX
@ultrajam
7 years ago
2,584 posts
Can you add to the skin lang and then reimport it?

/user/import_language

I haven't tried that, I add to custom modules and skins


--
¯\_(ツ)_/¯ Education, learning resources, TEL, AR/VR/MR, CC licensed content, panoramas, interactive narrative, sectional modules (like jrDocs), lunch at Uni of Bristol. Get in touch if you share my current interests or can suggest better :)

updated by @ultrajam: 02/06/17 03:46:12AM
douglas
@douglas
7 years ago
2,793 posts
blindmime:
There is a note in that file:

// DO NOT EDIT THIS FILE. THIS FILE IS ONLY LOADED DURING INSTALLATION.
// ANY CHANGES TO LANGUAGE STRINGS SHOULD BE DONE IN THE CONTROL PANEL!

You can add to the language file, you just have to run the Integrity Check tool after uploading the new language strings.

Hope this helps!


--

Douglas Hackney
Jamroom Team - Designer/Developer/Support
FAQ-Docs-Help Videos
michael
@michael
7 years ago
7,744 posts
What happens when a module is installed is the language file gets read. Any strings that are found are moved into the database so they can be over-ridden from the ACP.

If there is already a language string for the corresponding number in the database, its not updated.

So if initially you have
$lang[55] = 'System Updates';
and you change that in the language file, it will see that string 55 already has an entry in the database and not import it.

this is the reason I chose to start from $lang[1000] for your suggested additions. That will leave all the spaces up until 1000 free for the module to use.

Even if you do update the module, the language strings are now in the database so they will survive updates.

The only time I can think of where issues will arise is if that module ever gets to 1000 language strings and tries to enter 1001 but you have already claimed that position with your strings, so the modules ones wont get into your system.

Tags