61
trabis
Re: Proposal for a "universal language" system.
  • 2013/1/11 13:29

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


Quote:

irmtfan wrote:
I cannot see any problem. local functions in locale.php and translations in fa.php


Ah, I got it but... let me go back a little.
My first propose was 2 files per language:
1 - One file just for type casting (ex: XoopsLocale or ModuleLocale)
2 - One file to hold translations and methods (Ex: XoopsLocaleEn or ModuleLocaleEn)

Then I though you proposed 3 files per language
1 - One file for type casting
2 - One file for translations
3 - One file for methods

What you did propose however was using 2 files:
1 - One file for type casting and methods
2 - One file for translations

The only problem I see with your propose is that a pt_PT/XoopsLocale cannot extend a pt_BR/XoopsLocale and it would have to implement the methods with copy/paste. In my propose this could be done since the translation classes can extend other translation classes(they have different names).

Personally I think your propose is good/better. I think that all languages should extend just the english version. Full translations should be provided for pt_PT and for pt_BR and same goes for methods. You agree?



62
trabis
Re: Proposal for a "universal language" system.
  • 2013/1/11 7:52

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


Quote:
irmtfan wrote: then this in local language:
<?php
include_once dirname(dirname(__FILE__)) . '/en/en.php';
class 
XoopsLocalePt extends XoopsLocaleEn {
    const 
EDIT 'Editar';
    const 
DELETE 'Apagar';
    const 
HOME 'Início';
    
//const SAVE = 'Salvar';
}
But as you can see, we are extending XoopsLocalAbstract En version. How can I extend the Pt XoopsLocalAbstract since I'm already extending XoopsLocaleEn?



63
trabis
Re: XOOPS 2.6.0 Alpha 1 Testing
  • 2013/1/10 21:52

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


Quote:

Tarik wrote:
and this will do the trick also for system_block_mainmenu.html


Yes it does! I've committed the code, thank you very much :)

The install issue should be fixed already.



64
trabis
Re: XOOPS 2.6.0 Alpha 1 Testing
  • 2013/1/10 18:39

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


@tarik,
thank you for the report.
It is not just the notifications icon, it is happening to every module that does not use bootstrap icons. I think it is some css problem, perhaps you can look at it?



65
trabis
Re: XOOPS 2.6.0 Alpha 1 Testing
  • 2013/1/10 0:00

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


Quote:

Tarik wrote:
every time there is a change in svn i should do a fresh install o.O?


Not everytime, but we are kind on an alpha stage, things get moved, deleted.
Did you check your xoops_lib?



66
trabis
Re: XOOPS 2.6.0 Alpha 1 Testing
  • 2013/1/9 23:39

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


Quote:

Tarik wrote:
-_- tried updating my alpha 1 from svn and got this error
( ! ) Fatal error: Class 'Xoops_Cache' not found in C:wampwww2.6classpreload.php on line 88

Perhaps you did not update the xoops_lib folder??
You'd better doing a fresh install!



67
trabis
Re: Bug in last svn Publisher with permissions
  • 2013/1/9 22:20

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


@flaggada:
I could not reproduce number 3!

The other should be fixed now, please test it.



68
trabis
Re: Proposal for a "universal language" system.
  • 2013/1/9 21:33

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


Quote:

BitC3R0 wrote:
What do I mean?

1. For me, to write modules using strings with:

__('Text to be translated')


Is more transparent than:

define('CONSTANT','Text to be translated');



There are some downsides I can think of:
1 - performance is not good or as good as other methods.
2 - you may have to type the same loooooooooooong string in several scripts. If you type the string a little differently you need new translation so you start copy/pasting things around. With class method you type only once, then autocomplete can do the task for you.
3 - Because it does not use short keys, the translation itself becomes the key ( a long key). If I need to insert a config name or something else that needs translation in the database, I will need more space for the correspondent db field. For example, storing translation for a config description may become a problem (think xoops_version.php, notifications, templates, blocks, etc). A system using short keys, in my opinion, is more appropriated.



69
trabis
Re: Proposal for a "universal language" system.
  • 2013/1/9 21:04

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


Quote:

redheadedrod wrote:
I am assuming the INI files we are talking about are like the ones mentioned in this article:
http://devilsworkshop.org/tutorial/parsing-ini-files-using-php/12926/

Unless you can load a main INI file then over write the contents of memory with another INI file I think Trabis is on the right track with class constants.

When you parse the ini file you get an array. You can parse 2 ini files and then merge the arrays.



70
trabis
Re: Proposal for a "universal language" system.
  • 2013/1/9 20:56

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


Here is another package with 3 extra memusage/speed tests.
One is for php gettext used in rmcommon. (called gettext.php)
Another is for php gettext used in Sabai Framework(from onokazu) it uses a Pear class. (called sabai_gettext.php)
Another is for php extension gettext. (called ext_gettext.php)
I was not able to get the extension doing the translation. Perhaps somebody can fix it for me. Anyway, you can get an idea for the performance.




TopTop
« 1 ... 4 5 6 (7) 8 9 10 ... 190 »



Login

Who's Online

232 user(s) are online (161 user(s) are browsing Support Forums)


Members: 0


Guests: 232


more...

Donat-O-Meter

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

Latest GitHub Commits