Subject:*
<
Name/Email:*
<
Message Icon:*
<
Select*
<
Message:*
<



Click the Preview to see the content in action.
Options:*
<
Confirmation Code*
<
3 - 1 = ?  
Input the result from the expression
Maximum attempts you can try: 10
*
<
     
only when $image, $alt is set and optional $display not set global $xoopsModuleConfig; if (func_num_args()== 2){ // overall setting if( !empty($xoopsModuleConfig['display_text_links']) ){ $display=false; } // if set for each link => overwrite $display if (isset($xoopsModuleConfig['display_text_each_link'][$image])){ $display = empty($xoopsModuleConfig['display_text_each_link'][$image]); } } // END hacked by irmtfan if (empty($display)) { return $icon_handler->assignImage($image, $alt, $extra); } else { return $icon_handler->getImage($image, $alt, $extra); } } [/code] and function setImage is in newbb/class/icon.php [code] function setImage($image, $alt = "", $extra = "") { if (!isset($this->images[$image])) { $image_src = $this->getImageSource($image); // irmtfan add id={$image} $this->images[$image] = ""; } } [/code] You can see the beauty of this method. please look at newbb/class/icon.php and newbb/include/functions.render.php for more information. The programing is finished in core and after that all module developers can use this class very very easy like this: in any module the module developer can use this images core class like this: 1- module developer define all [b]its own[/b] images and icons in a file like MODULE/images.php [code] $moduleImage[''] = // no need to define pdf rss and print icons we can read theme from system module icons //$moduleImage['rss'] = //$moduleImage['pdf'] = //$moduleImage['printer'] = $moduleImage['post'] = // no need for poll icon we can read it from xoopspoll module!!! //$moduleImage['poll'] = $moduleImage['subforum'] = "icon"; // for icons (images with no text) $moduleImage['p_delete'] = $moduleImage['p_reply'] = $moduleImage['p_quote'] = $moduleImage['p_edit'] = $moduleImage['p_report'] = "language"; // for images with text or left right alignment .... return $moduleImage; [/code] (core image class should read it from all modules) 2- assign a smarty variable in the script like this: [code] $icon_pdf= displayImage('system', 'pdf', _PDF); // get the icon from system module. $xoopsTpl->assign('icon_pdf', $icon_pdf); $icon_postedit= displayImage($xoopsModule->getVar("dirname"), 'p_edit', _EDIT); $xoopsTpl->assign('icon_pdf', $icon_postedit); [/code] and just use that in the theme/templates will be: [code] [/code] and: will be: [code] [/code] and maybe we can use one module icon in another module: eg: xoopspoll icon poll.png in newbb module will be: [code] [/code] I hope i could explain it totally. I need your opinions. im not a coder and maybe some codes are not correct. Edit: possible question: what is the benefit of having the themes/default prior to modules/MODULE/templates/? The big advantages are: 1- when you update a module you dont overwrite the custom images 2- new users will not confused because we guid them that all customization/localization can be done inside themes folder and no where else. 3- we can do anything with modules in the future and even move them outside wwwroot and all themes are still worked just fine. [/quote]" />

Re: XOOPS 2.6 Internationalization/Local support
by trabis on 2013/1/25 8:11:08

Quote:

irmtfan wrote:
@Trabis:
I review your updates. they are really fantastic.
Now all local needs are covered include isRtl and isMultiByte.

just 2 point:
1- will you add strtotime in the future?

2- a bug in your example pt_BR in xoops26/locale/pt_BR/locale.php
le="color: #000000"><?php class XoopsLocale extends XoopsLocaleEn_US{


should be XoopsLocalePt_BR


I'm glad you like it!
It is an ongoing process, right now I'm just covering the legacy. You should expect other methods later on.
Re: XOOPS 2.6 Internationalization/Local support
by irmtfan on 2013/1/25 5:04:17

@Trabis:
I review your updates. they are really fantastic.
Now all local needs are covered include isRtl and isMultiByte.

just 2 point:
1- will you add strtotime in the future?

2- a bug in your example pt_BR in xoops26/locale/pt_BR/locale.php
le="color: #000000"><?php class XoopsLocale extends XoopsLocaleEn_US{


should be XoopsLocalePt_BR
Re: XOOPS 2.6 Internationalization/Local support
by irmtfan on 2013/1/23 4:11:15

well done Trabis. You have a very catchy eye.
Honestly we didnt have any major issue with the old definitions in persian as a RTL language.
I mean gender or plural words or even case sensivity are important for english or latin users but in persian they are not important.

the colon is not important in persian too but it is better to be recognized as you proposed.
just about question mark i should confirm that we have a different question mark in persian (en:? fa:؟)
Re: XOOPS 2.6 Internationalization/Local support
by Mamba on 2013/1/23 1:22:46

There are tons of materials on "gender" and "plural" in translations:

http://www.gramps-project.org/wiki/index.php?title=Coding_for_translation
http://www.mediawiki.org/wiki/Manual:Messages_API
http://forum.kohanaframework.org/discussion/6833/i18n-module-for-kohana-3/p1
http://nedohodnik.net/gettextbis/index.html
http://www.gnu.org/software/gettext/manual/gettext.html

Maybe you'll find something useful. If possible, it would best to pick one established standard for gender/plural related issues (like in Gettext) or something similar, and use it consistently, so we could always forward people there to study it, if in doubts.
Re: XOOPS 2.6 Internationalization/Local support
by trabis on 2013/1/22 22:29:22

Quote:

flipse wrote:
I can't reproduce examples now but most difficulties when translating arrise when strings are used on more then one place. In some cases an English phrase or word cannot be used in a different context where it is no problem in the original language. Avoiding similar language strings at more places might be translator friendly but can be a pain in the ass in some cases.


In Portuguese I have problems with single words.
TEXT used in "article text" is different than "text a friend".
In this refactoring I'm prepending A_ (action) on single words that are also verbs.
The keys are also being extended to provide
Here are some of the conventions I've applied so far:
Quote:

/**
* Naming conventions
* - All translations must be enclosed with ""
* - All translations must start with Uppercase, do not use CamelCase
* Good ex: "User groups"
* Bad ex: "user groups" or "User Groups"
* - All keys must be as descriptive as possible.
* - All keys must use complete words between each '_',
* - Keys should be prepended with identifiers in following cases:
* F_ Formatted, use this when strings are parsed with sprintf()
* A_ Action, use this when using a single word which is a verb
* S_ Success, use this for success messages and exclamations
* E_ Error, use this for error messages
* C_ Colon, use this when string ends with a colon ":"
* Q_ Question, use this when string is a question
* - Chain keys alphabetically with the exception of F, F always comes in last
* ex: SF_ (formatted success message), EF_ (formatted error message)
* - Special cases:
* CONF_ Configs, prepend this for your module configs.
* Config keys are stored in database, try to make them as short as possible!
* _DESC Description, append this for configs description
*/

Who's Online

794 user(s) are online (748 user(s) are browsing Support Forums)


Members: 0


Guests: 794


more...

Donat-O-Meter

Stats
Goal: $15.00
Due Date: Jul 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $15.00
Make donations with PayPal!

Latest GitHub Commits