language file structure

16 years 1 month ago #58529 by houbahop
language file structure was created by houbahop
Hi,

I wonder if it could be usefull or not to have two language files for each language.

One for cb related strings

An other for the website customs strings (tab names, fields, etc..)

I have just upgraded to a new cb, and it was painfull to copy/paste my website's strings from my old language file to the new one. And that for all languages.

Well... not so painfull, but easy to make an error/forget a string with that system.


That is just an idea.. Maybe it's not acceptable.

Please Log in to join the conversation.

16 years 1 month ago #58611 by beat
Replied by beat on topic Re:language file structure
Could you please expand a little bit on this idea and give some classification examples ? :)

Beat - Community Builder Team Member

Before posting on forums: Read FAQ thoroughly -- Help us spend more time coding by helping others in this forum, many thanks :)
CB links: Our membership - CBSubs - Templates - Hosting - Forge - Send me a Private Message (PM) only for private/confidential info

Please Log in to join the conversation.

16 years 1 month ago #59114 by houbahop
Replied by houbahop on topic Re:language file structure
Hi Beat,

Sorry, it was not as clear that what I was thinking. So I try again with examples now.

CB can be multilingual thanks to a file that is holding all interface strings. for example default.php for the original english file. French.php for the french translation, and so on...

When I create some tabs for the user profiles, I can set the tab name in the tab config , through the backend.
But as my website is multilingual, I don't write the tab caption there. Instead, I write a constant as the tab caption, and this constant and his matching caption is added in the language file (the one that allready has all interface strings).

So.... My suggestion would be to find a solution to forget that behaviour.
When I have updated cb, I have carefully updated my language files too. I have copy pasted all my website's related strings (tabs, registration, etc..) in the new files.

It can lead to some errors when you copy paste your website's strings(it involves to save before install, copy at the right place, etc.)

So.. my idea would be to have an other lang file for each language. That would only hold the constants related to the website, the webmaster choices. And not cb.

So... with that system, when you upgrade cb, you don't care of your custom constants and you only do a copy/paste of the new language files.

Do you catch better now ?

As I am writting this, I realize that it's maybe allready possible to make an include in the default language file to add the file holding the custom constants. But I'm not sure at all, and I think that since everyone don't know that that is possible (if it's possible), they will put all their constants in the same file again.

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.237 seconds

Facebook Twitter LinkedIn