Joomla components admin menu - translation methods

A place to discuss Joomla! translation matters.

Moderator: wendhausen

Locked
User avatar
horus_68
Joomla! Ace
Joomla! Ace
Posts: 1495
Joined: Sun Sep 25, 2005 5:29 am
Location: Porto - Portugal

Joomla components admin menu - translation methods

Post by horus_68 » Sun Jun 03, 2007 11:59 am

To have Joomla 100% translated also requires that component menu entries at admin side will be translated to the default language

Normally you find at xml install file the names that will be used as entries at admin component menu.

Code: Select all

<administration>
    <menu>Component XYZ</menu>
    <submenu>
         <menu task="config">Edit Config</menu>
    </submenu>
Solutions:
- You can edit that file and get the names at your language , then re-pack the files and install the new and localized version. But it would imply that everybody would have to do this!

- You can have another extension to translate the names. Not the best solution, so then we will have another tool with specific issue, when we only want is the component menu names translated.
And it would imply that the extension could be abandoned as it happens to the extension Link Editor ( from http://www.sonerekici.com and formerly at http://extensions.joomla.org/component/ ... Itemid,35/ - its not listed any more!)


Where to go?
We need a better and "beautiful" solution (and for "we" I mean those who don't want to have their sites admin in English!)

- Your opinion counts
I think we need some common method for the translation of the components admin menus.
If we can find some agreement on a method it could be addressed has a proposal to 3rd party developers.

Sure it will not be a mandatory thing but it will be a feature that every component can claim they have implemented:
"Components Admin Menus Localization" or "CAML"
Last edited by horus_68 on Sun Jun 03, 2007 1:02 pm, edited 1 time in total.
Portuguese Joomla Community / Joomla pt-PT Translation Team

User avatar
horus_68
Joomla! Ace
Joomla! Ace
Posts: 1495
Joined: Sun Sep 25, 2005 5:29 am
Location: Porto - Portugal

Re: Joomla components admin menu - translation methods

Post by horus_68 » Sun Jun 03, 2007 12:00 pm

My proposal? (or my 2 cents to the "Component Admin menus localization" or "CAML")
3rd party developers should use language files to translate menu names (at least at install time)

- When installing a component the menu names sould be created from the language file for that component (reporting the standard language for the site).
That is the solution that I found at component Jbook

jbook http://extensions.joomla.org/component/ ... Itemid,35/

They still use the XML statment:

Code: Select all

<administration>
		<menu>Catalogo libri</menu>
			<submenu>
                    <menu link="option=com_jbook&section=categories">Categorie</menu>
                    <menu link="option=com_jbook&section=auth">Autori</menu>
                    <menu link="option=com_jbook&section=editor">Editori</menu>
      				<menu link="option=com_jbook&section=book">Libri</menu>
      				<menu link="option=com_jbook&section=com">Commenti</menu>
                    <menu link="option=com_jbook&section=export">Esportazione XML libri</menu>
                    <menu link="option=com_jbook&section=import">Importazione XML libri</menu>
                    <menu link="option=com_jbook&section=settings">Settings</menu>

    			</submenu>
but then they use the file install.jbook.php with the code:

Code: Select all

<?php
function com_install()
{ 
    
    // db operations
    global $database,$mosConfig_absolute_path,$mosConfig_lang;
if (file_exists( $mosConfig_absolute_path ."/administrator/components/com_jbook/language/{$mosConfig_lang}.php" )) {
	include_once( $mosConfig_absolute_path ."/administrator/components/com_jbook/language/{$mosConfig_lang}.php" );
} else {
	include_once( $mosConfig_absolute_path ."/administrator/components/com_jbook/language/italian.php" );
}


    $database -> setQuery("UPDATE #__components SET admin_menu_img = 'js/ThemeOffice/document.png', name = '"._MODULE_NAME."' WHERE name= 'Catalogo libri'");
	print "<ol><li> remove admin menu images";
    $database -> query();

    print "<li> add new admin menu images</ol>";
    $database -> setQuery("UPDATE #__components SET admin_menu_img = 'js/ThemeOffice/document.png', name = '"._BOOKS."' WHERE admin_menu_link='option=com_jbook&section=book'");
    $database -> query();
    $database -> setQuery("UPDATE #__components SET admin_menu_img = 'js/ThemeOffice/users.png', name = '"._AUTHORS."' WHERE admin_menu_link='option=com_jbook&section=auth'");
    $database -> query();
    $database -> setQuery("UPDATE #__components SET admin_menu_img = 'js/ThemeOffice/language.png', name = '"._EDITORS."' WHERE admin_menu_link='option=com_jbook&section=editor'");
    $database -> query();
    $database -> setQuery("UPDATE #__components SET admin_menu_img = 'js/ThemeOffice/categories.png', name = '"._CATEGORIES."' WHERE admin_menu_link='option=com_jbook&section=categories'");
    $database -> query();
    $database -> setQuery("UPDATE #__components SET admin_menu_img = 'js/ThemeOffice/content.png', name = '"._COMMENTS."' WHERE admin_menu_link='option=com_jbook&section=com'");
    $database -> query();
    $database -> setQuery("UPDATE #__components SET  name = '"._EXPORT."' WHERE admin_menu_link='option=com_jbook&section=export'");
    $database -> query();
    $database -> setQuery("UPDATE #__components SET admin_menu_img = 'js/ThemeOffice/content.png', name = '"._IMPORT."' WHERE admin_menu_link='option=com_jbook&section=import'");
    $database -> query();
    $database -> setQuery("UPDATE #__components SET admin_menu_img = 'js/ThemeOffice/config.png', name = '"._SETTINGS."' WHERE admin_menu_link='option=com_jbook&section=settings'");
    $database -> query();

}

?>
This way the names used for component admin menus are stated at the site default language for the component on strings like

Code: Select all

DEFINE ('_EXPORT', 'Exportar');
DEFINE ('_IMPORT', 'Importar');
I think its a good solution, maybe just a little bit more specific strings (to have the language files a little bit mode cleaned up)

Code: Select all

DEFINE ('_ADMINMENU_IMPORT', 'Importar');
- Tweek the code
I'm not a programmer and don't know if the code could be improved. It would be a nice feature to give 3d party developers a standard code!
Last edited by horus_68 on Sun Jun 03, 2007 1:01 pm, edited 1 time in total.
Portuguese Joomla Community / Joomla pt-PT Translation Team

User avatar
wojtekkk87
Joomla! Apprentice
Joomla! Apprentice
Posts: 34
Joined: Thu Mar 29, 2007 6:25 pm
Location: Poland
Contact:

Re: Joomla components admin menu - translation methods

Post by wojtekkk87 » Fri Apr 11, 2008 12:44 pm

Hi!
I'm looking around, and I've found this topic. I'm trying to do the same to have menu component name translation depended of the global language settings. It's possible now? Now I make it like:

Code: Select all

<administration>
      <menu>English component name</menu>
but it's not what I need. I would like to have posibility to change it automaticly to e.g. Polish name if it's a my Joomla language, or if I change it from english to polish.

I don't want to have still the same name. Could anybody help me?

I hope You understand me;)
I'm trying to understand ...

rajup
Joomla! Apprentice
Joomla! Apprentice
Posts: 31
Joined: Thu Aug 20, 2009 9:24 am

Re: Joomla components admin menu - translation methods

Post by rajup » Mon Sep 21, 2009 6:30 am

Code: Select all

<administration>
    <menu>Component XYZ</menu>
    <submenu>
         <menu task="config">Edit Config</menu>
    </submenu>
where can I get above .xml file??


Locked

Return to “Translations”