Page 1 of 1

Bulding Extension's Language Pack for J1.5

Posted: Wed Aug 23, 2006 8:15 am
by sifix
Hallo,
I am trying to create an component extension for Joomla 1.5 and I havequestions regarding language packs.

Are there any insructions on how to combine a language pack with the extension?
I use the JText::_( 'NAME' ); but I don't know where to put my language file

I tried the following but it didn't work.
I create a file en-GB.com_mycomp.ini and placed it in \language\en-GB (both in admin and frond area)
NAME=the name is
but unfortunately joomla did not read my ini file
So instead of displaying "the name is" it displays "NAME"

I don't know if the above method is correct or I do something wrong, ???
I am sorry for bothering but the section with How-to's is still empty ( http://dev.joomla.org/component/option, ... languages/ )

I would appreciate if you could help me
Thank you very much

I am sorry I found what I did wrong.. It had nothing to do with the above.
The above are correct

As also is mentioned here
http://forum.joomla.org/index.php/topic ... #msg432913

Keep on the good work..  :)

Re: Bulding Extension's Language Pack for J1.5

Posted: Sat Aug 26, 2006 8:41 pm
by davidgal
Hi,

In your installation xml you need a tag group for site language packs and for admin packs.
each language file should be enclosed in a tag and should have the sub folder of the specific language included i.e 'fr-FR/fr-FR.com_mycomponent.ini'

The concept is that any language pack inside the component installation package will be added to existing language folders for each language. If there is no core language installed the file will be discarded. It is also possible to create separate language packs for later installation to existing (installed) components. These install like regular language packs but without the metadata xml and with out the 'core' flag in the installation xml file.

I will be created the language spec doumentation in the near future. In the mean time I hope that this helps.

David

Re: Bulding Extension's Language Pack for J1.5

Posted: Fri Sep 01, 2006 3:37 pm
by eyezberg
This
davidgal wrote: ...It is also possible to create separate language packs for later installation to existing (installed) components. These install like regular language packs but without the metadata xml and with out the 'core' flag in the installation xml file....

David
is WAY cool!! Great news! Beta beta beta ... :)

Re: Bulding Extension's Language Pack for J1.5

Posted: Tue Aug 04, 2009 4:10 pm
by sakiss
That means that you can install the language ini file imediatelly from joomla backend ?

Should other files being contained with the language ini file (ex. a zip with ini and xml)?

Re: Bulding Extension's Language Pack for J1.5

Posted: Fri Aug 07, 2009 7:59 am
by Eraser
sakiss wrote:That means that you can install the language ini file imediatelly from joomla backend ?

Should other files being contained with the language ini file (ex. a zip with ini and xml)?
Yep, language files of the component/module/plugin can be installed with the Joomlas installer.

You can do it automatically with different automatic components like Language Manager. But You can do it by hand also.

In a zip file there need to be files like that:

et-EE-zoo-10.zip
  • admin (folder)
    • et-EE.com_zoo.ini
  • site (folder)
    • et-EE.com_zoo.ini
  • install.xml

Content of the install.xml file should be looking something like that:

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<install version="1.5" client="both" type="language" method="upgrade">
	<name>Zoo Estonian (Eesti)</name>
	<tag>et-EE</tag>
	<version>2.0.2</version>
	<creationDate>2009-04-02</creationDate>
	<author>Eraser</author>
	<authorEmail>[email protected]</authorEmail>
	<authorUrl>www.eraser.ee</authorUrl>
	<copyright>(C) 2005 - 2009 Eraser. All rights reserved.</copyright>
	<license>http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL</license>
	<description>Estonian translation for Zoo 1.0.3 Site and Admin (Joomla! 1.5.x)</description>
	<administration>
		<files folder="admin">
			<filename>et-EE.com_zoo.ini</filename>
		</files>
	</administration>
	<site>
		<files folder="site">
			<filename>et-EE.com_zoo.ini</filename>
		</files>
	</site>
	<params />
</install>
Edit it according to Your special need and that's it. ;)

You can find the file i show as an example here from this url. Download it and learn from this example.

Re: Bulding Extension's Language Pack for J1.5

Posted: Thu Sep 17, 2009 3:02 pm
by sakiss
Man i really thank you

Re: Bulding Extension's Language Pack for J1.5

Posted: Tue Nov 30, 2010 11:00 pm
by foto50
Thanks as well, I now can provide extra language packages for my component without having to zip (and xml) them into the entire install.xml.

I had to try quite a bit to get that running for a module and thought, my solution might help others to avoid searching and trying:

Since the module does not have any files for <administration> I thought, it's good enough just to delete this section, but DONT!

When there is no language file for administration, you need to keep an empty node for it in the install.xml! Like:

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<install version="1.5" client="both" type="language" method="upgrade">
   <name>mod_opensim_friends english</name>
   <tag>en-GB</tag>
   <version>0.1.7</version>
   <creationDate>2010-11-30</creationDate>
   <author>FoTo50</author>
   <authorEmail>blabla email</authorEmail>
   <authorUrl>blabla website</authorUrl>
   <copyright>(C) 2010 FoTo50. All rights reserved.</copyright>
   <license>http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL</license>
   <description>English translation for mod_opensim_friends Site and Admin (Joomla! 1.5.x)</description>
   <administration />
   <site>
      <files folder="site">
         <filename>en-GB.mod_opensim_friends.ini</filename>
      </files>
   </site>
   <params />
</install>
The <administration /> is the important line for it. Otherwise you get errors like:

Code: Select all

PHP Fatal error:  Call to a member function getElementByPath() on a non-object in /some.joomla.path/libraries/joomla/installer/adapters/language.php on line 70
I hope this helps one or the other

Greetz
FoTo50

Re: Bulding Extension's Language Pack for J1.5

Posted: Sun Feb 13, 2011 11:40 pm
by Eraser
And of course - same goes for the frontend (site) files also ... ;)

Re: Bulding Extension's Language Pack for J1.5

Posted: Fri Jan 20, 2012 1:04 pm
by sh4n0n
foto50 wrote:Thanks as well, I now can provide extra language packages for my component without having to zip (and xml) them into the entire install.xml.

I had to try quite a bit to get that running for a module and thought, my solution might help others to avoid searching and trying:

Since the module does not have any files for <administration> I thought, it's good enough just to delete this section, but DONT!
Image
When there is no language file for administration, you need to keep an empty node for it in the install.xml! Like:

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<install version="1.5" client="both" type="language" method="upgrade">
   <name>mod_opensim_friends english</name>
   <tag>en-GB</tag>
   <version>0.1.7</version>
   <creationDate>2010-11-30</creationDate>
   <author>FoTo50</author>
   <authorEmail>blabla email</authorEmail>
   <authorUrl>blabla website</authorUrl>
   <copyright>(C) 2010 FoTo50. All rights reserved.</copyright>
   <license>http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL</license>
   <description>English translation for mod_opensim_friends Site and Admin (Joomla! 1.5.x)</description>
   <administration />
   <site>
      <files folder="site">
         <filename>en-GB.mod_opensim_friends.ini</filename>
      </files>
   </site>
   <params />
</install>
The <administration /> is the important line for it. Otherwise you get errors like:

Code: Select all

PHP Fatal error:  Call to a member function getElementByPath() on a non-object in /some.joomla.path/libraries/joomla/installer/adapters/language.php on line 70
I hope this helps one or the other

Greetz
FoTo50
really well explained. great work and thank you so much!
served me well and somewhat saved my weekend.. ;)