Plugin programming: How to "include" english language file?

Third Party Plugins to CMSimple - how to install, use and create plugins

Moderator: Tata

Post Reply
svasti
Posts: 1660
Joined: Wed Dec 17, 2008 5:08 pm

Plugin programming: How to "include" english language file?

Post by svasti » Fri Sep 23, 2011 9:36 am

Hi the experts,
small problem here:
I want to have the English language items in my plugins as default, in case I don't have them in other languages.
Say I have 100 items in the language file, but only 4 translated into Italian. Now my Italian friend should get the 4 Italian descriptions and the rest in English.
Sorry, tried hard, but couldn't find how to do this. ... include? ...merge_array?

svasti

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: Plugin programming: How to "include" english language file?

Post by cmb » Fri Sep 23, 2011 9:51 am

Hi Frank,

it should suffice to include both language files in the right order:

Code: Select all

include 'en.php';
include 'it.php';
 
So only the entries that are defined in it.php will overwrite the according entries from en.php.

This feature will probably be implemented in CMSimple_XH 1.5.

Christoph
Christoph M. Becker – Plugins for CMSimple_XH

svasti
Posts: 1660
Joined: Wed Dec 17, 2008 5:08 pm

Re: Plugin programming: How to "include" english language file?

Post by svasti » Fri Sep 23, 2011 10:25 am

Oh, so easy, ... I just tried it and it works great!
Thanx a lot, Christoph

svasti

Martin
Posts: 346
Joined: Thu Oct 23, 2008 11:57 am
Contact:

Re: Plugin programming: How to "include" english language file?

Post by Martin » Fri Sep 23, 2011 12:30 pm

Hallo,
Christoph wrote:This feature will probably be implemented in CMSimple_XH 1.5.
Yes. Core and plugins will handle languages this way: load English as default and overwrite it as far as possible with the available texts of the selected language.

KR

Martin

Post Reply