[PEPr] Proposal for Internationalization::Arabic

View: New views
18 Messages — Rating Filter:   Alert me  

[PEPr] Proposal for Internationalization::Arabic

by Khaled Al-Shamaa-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Khaled Al-Shamaa (http://pear.php.net/user/arphp) proposes Internationalization::Arabic.

You can find more detailed information here:
 http://pear.php.net/pepr/pepr-proposal-show.php?id=617

--
PEAR Development Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PEPr] Comment on Internationalization::Arabic

by Christian Weiske-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


- You should follow the PEAR package layout: Classes in Arabic/ need have
the Class name Arabic_$class.

- I doubt that Arabic is the correct prefix for the package, maybe
I18N_Arabic is better.

--
http://pear.php.net/pepr/pepr-proposal-show.php?id=617

--
PEAR Development Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PEPr] Comment on Internationalization::Arabic

by David Coallier-5 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


- If I were you I would read: http://pear.php.net/manual/en/standards.php
and to make sure your code complies to the coding standards you can use
PHP_CodeSniffer which will help you identify parts of the code that do not
comply to PEAR coding standards



- I do think I18N_Arabic could be a better name as well



- What you could do is put your code on github.com and from there we will
be able to fork and give you tips (Seeing it online instead of downloading
will greatly improve the amount of comments you'll receive)

--
http://pear.php.net/pepr/pepr-proposal-show.php?id=617

--
PEAR Development Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PEPr] Comment on Internationalization::Arabic

by Khaled Al-Shamaa :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks Christian and David,

- I agree with you that I18N_Arabic will be better name for this package,
thanks for your advice, I will do it

- Thanks Christian for your advice in naming sub classes using PEAR
standard, I think it should be I18N_Arabic_$class

- Dear David, source code already hosted on sourceforge.net, sorry because I
did not mention that, you can find it here:
http://sourceforge.net/projects/ar-php/
Well, I wish to shift it into github.com, but I don't know an easy way to
import my CVS repository and keep developing history

- Dear David, thanks for your advices to use PHP_CodeSniffer, I will do scan
all may files using that tool fix all reported issues, I suppose using
following command will be enough to satisfy PEAR standards:
phpcs --standard=Zend -n $filename

So, I will do my homework then back to you :o)

Best regards,
Khaled

On Wed, Nov 4, 2009 at 2:22 PM, David Coallier <david@...> wrote:

>
> - If I were you I would read: http://pear.php.net/manual/en/standards.php
> and to make sure your code complies to the coding standards you can use
> PHP_CodeSniffer which will help you identify parts of the code that do not
> comply to PEAR coding standards
>
> - I do think I18N_Arabic could be a better name as well
>
> - What you could do is put your code on github.com and from there we will
> be able to fork and give you tips (Seeing it online instead of downloading
> will greatly improve the amount of comments you'll receive)
>
> --
> http://pear.php.net/pepr/pepr-proposal-show.php?id=617
>



--
http://www.ar-php.org
PHP and Arabic language solutions by Khaled Al-Shamaa

Re: Re: [PEPr] Comment on Internationalization::Arabic

by David Coallier-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

<snip>

> - Dear David, source code already hosted on sourceforge.net, sorry because I
> did not mention that, you can find it here:
> http://sourceforge.net/projects/ar-php/
> Well, I wish to shift it into github.com, but I don't know an easy way to
> import my CVS repository and keep developing history
>

Ok cool stuff :) If you can link your CVS sources in your package
links that'd be good :)

> - Dear David, thanks for your advices to use PHP_CodeSniffer, I will do scan
> all may files using that tool fix all reported issues, I suppose using
> following command will be enough to satisfy PEAR standards:
> phpcs --standard=Zend -n $filename
>

$ phpcs --standard=PEAR /path/to/code/myfile.inc

--
Slan,
David

--
PEAR Development Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PEPr] Comment on Internationalization::Arabic

by shady massalha :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


I already use this package in all my projects. As non-Arabic speakers you
may not feel how much relief it caused to us to have this Arabic class. A
lot of solutions was made to help Arabic programmers but no one is even
close to this one.

Now, I use it in Adobe Flash, Adobe PhotoShop and all softwares i have to
write Arabic with embedded fonts and antialias.

See some samples where all made by this package:

http://layan.us/write-arabic-in-flash/  You may see it as simple sample,
but to us its WOW.. finally we can write Arabic in flash this way.

http://layan.us/go/arabic_captcha/ Simple Captcha but with arabic
letters.

And again in http://muslim-names.us Where i write Arabic Names using GD2
library... And in the same website
http://muslim-names.us/%D8%AA%D9%81%D8%B3%D9%8A%D8%B1_%D8%A7%D9%84%D8%A3%D8%AD%D8%B1%D9%81_%D9%85%D9%86_%D8%A7_%D8%A7%D9%84%D9%89_%D8%AE/
Where all these clouds generated in Flash but the text was generated by PHP
Arabic Class.



Khaled ilshama`a made the best CLASS to the Arab world. you must approve
his solution.



Thanks in advanced.

--
http://pear.php.net/pepr/pepr-proposal-show.php?id=617

--
PEAR Development Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PEPr] Comment on Internationalization::Arabic

by Ken Guest :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Would it seem realistic to refactor portions of this into established
packages? for example the spelling of numbers could be refactored into the
Numbers_Words package.



Impressive work - though I must admit I18N_Arabic would be a better name
for the package. It would also be a good idea to provide unit tests.

--
http://pear.php.net/pepr/pepr-proposal-show.php?id=617

--
PEAR Development Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PEPr] Comment on Internationalization::Arabic

by David Coallier-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

2009/11/4 shady massalha <massalha@...>:

>
> I already use this package in all my projects. As non-Arabic speakers you
> may not feel how much relief it caused to us to have this Arabic class. A
> lot of solutions was made to help Arabic programmers but no one is even
> close to this one.
> Now, I use it in Adobe Flash, Adobe PhotoShop and all softwares i have to
> write Arabic with embedded fonts and antialias.
> See some samples where all made by this package:
> http://layan.us/write-arabic-in-flash/  You may see it as simple sample,
> but to us its WOW.. finally we can write Arabic in flash this way.
> http://layan.us/go/arabic_captcha/ Simple Captcha but with arabic
> letters.
> And again in http://muslim-names.us Where i write Arabic Names using GD2
> library... And in the same website
> http://muslim-names.us/%D8%AA%D9%81%D8%B3%D9%8A%D8%B1_%D8%A7%D9%84%D8%A3%D8%AD%D8%B1%D9%81_%D9%85%D9%86_%D8%A7_%D8%A7%D9%84%D9%89_%D8%AE/
> Where all these clouds generated in Flash but the text was generated by PHP
> Arabic Class.

I'm glad it helped a lot of people and we are certainly looking
forward in having this package in PEAR so it can become even easier
for the Arab world to distribute and use the package.

However in order for a package to be accepted it needs to comply to
certain rules and standards in order to keep the level of
maintainability and quality in general high.

This package needs some work in terms of standardization and I'm sure
we can provide great help and tips on improving the structure of the
package itself in order to make it much more flexible and to make it
comply to our standards.

Khaled, if you need help at some point do not hesitate to ask for it
as we understand it can sometimes be quite difficult to adhere to
standards and change existing practices.

We'll do whatever needs to be done in order to mentor and help you
along the way :)

Cheers,

--
Slan,
David

--
PEAR Development Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PEPr] Comment on Internationalization::Arabic

by Mohamed Waheed :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


- I see that this package solved many problems in our Arabic projects, it
almost have all what we need to deal with Arabic texts, words, date and
time very efficiently.



- Given that the programmer uses these features very often, I think it's
very reasonable to gather them in one package, under a short and identical
prefix like 'Arabic_'.

--
http://pear.php.net/pepr/pepr-proposal-show.php?id=617

--
PEAR Development Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PEPr] Comment on Internationalization::Arabic

by Philippe Jausions-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


I am with Ken on this one. I'd be a proponent for refactoring some of the
code into existing packages where the functionality fit, or at least making
several packages because not all features are I18N per se. Numbers, Date,
Text_LanguageDetect, etc...

--
http://pear.php.net/pepr/pepr-proposal-show.php?id=617

--
PEAR Development Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PEPr] Comment on Internationalization::Arabic

by David Coallier-5 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


I am definitely for refactoring, in fact I will not vote +1 on this if it
isn't. It is a great package but it has to comply and refactoring is not
only for the sake of refactoring.



@Mohamed The idea behind making the code more decoupled is because it is
easier to distribute (say you want to use only "x" part of the arabic
package, you don't need the whole package, only part "x") and obviously the
quality of each package can be maintained in a much more controlled way. By
having a variety of independent packages, you can insure better unit
testing of each package and that is a great asset.



What I would suggest is that you try to identify all the parts that are
independent to one another and see which is the real core, and how all the
pieces are stuck together.



This means you'll have one main package which will depend on all the
smaller packages however the smaller packages will NOT depend on the bigger
ones thus making them independent.



If you need help on how to refactor your code I would highly suggest
sending an email to the pear-dev mailing list to request comments on how to
do it.



On another note, the name "Arabic" does not fit a category name. It is
Arabic in the Internationalization category (i18n). So something like
I18N_Arabic makes much more sense and I'd be surprised to see "Arabic_*"
accepted :)

--
http://pear.php.net/pepr/pepr-proposal-show.php?id=617

--
PEAR Development Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PEPr] Comment on Internationalization::Arabic

by Khaled Al-Shamaa-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


I agree with you that I18N_Arabic will be better name for this package,
thanks for your advice, I will do it.



Thanks Christian for your advice in naming sub classes using PEAR
standard, I think it should be I18N_Arabic_$class



Dear David, source code already hosted on sourceforge.net, sorry because I
did not mention that before, you can find it here:
http://sourceforge.net/projects/ar-php/



Well, I wish to shift it into github.com, but I don't know an easy way to
import my CVS repository and keep tracking history … himmm, it seems that
we have a lot of changes in file and directory names (which can’t be
tracking by CVS), so I believe it is a good time to get a new start point
using better technology like Git instead of CVS.



Dear David, thanks for your advices to use PHP_CodeSniffer, I will do scan
all of my files using that tool and fix all reported issues, so … I have
to do my homework then back to you :o)



Dear Shady and Mohamed, thanks for your support, but at the end of the
day, standards are standards, and one of the PEAR success cause is their
high level standards.

--
http://pear.php.net/pepr/pepr-proposal-show.php?id=617

--
PEAR Development Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PEPr] Comment on Internationalization::Arabic

by Khaled Al-Shamaa-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Dear Ken, Philippe and David,



Related to the refactoring issue, I feel that split this package into
smaller packages will make it harder to maintain and implement, please pear
in your mind that most of the package functionality share the core of
transparent charter set converter (actually roughly of Arabic websites used
UTF-8 while other half still used Windows-1256 with a small share for ISO
-8859-6).



On the other hand, we already implement semi-factory pattern, so logical
modules are separated in different sub classes in different files and
loaded dynamically on request, this structure keep code maintainable.



I like to think about it as Swiss-army knife for Arabic website developers
where they can find most of their day to day needs (related to Arabic
language), so pack it in one PEAR package will make implementation and
deployment much easier and needs less memory footprint.



In light of those facts, do you still believe that it is better to have
several small packages? I am open to any suggestion that will improve this
piece of work.

--
http://pear.php.net/pepr/pepr-proposal-show.php?id=617

--
PEAR Development Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PEPr] Changes in proposal for Internationalization::Arabic

by Khaled Al-Shamaa-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Khaled Al-Shamaa (http://pear.php.net/user/arphp) has edited the proposal for Internationalization::Arabic.

Change comment:

Changes made to satisfy some of the PEAR members comments includes:



Packages name, sub classes names, follow PEAR and ZEND code standards
(using phpcs with -n flag), regenerate documents to reflect latest changes,
make the whole package available on SVN repository on sourceforge.net
website and add link to browse it, provide better set of Examples.



Please note that I don't compile new PEAR package yet reflect those
updates until we give it more discussion time.

Please review the proposal:
http://pear.php.net/pepr/pepr-proposal-show.php?id=617

--
PEAR Development Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PEPr] Comment on Internationalization::Arabic

by Till Klampaeckel-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


First off, this class is insanely comprehensive. I totally see why this is
the standard out there. Really well done. I have some (rather random)
suggestions, let me/us know what you think.



 - general suggestions

  - fix file structure

   - e.g. I18N_Arabic, should live in I18N/Arabic.php

  - set-methods could return $this to build a fluent interface

  - i'd clean-up the naming, so you always have obvious get*() and set*()
functions

  - always avoid private (use protected instead)

  - avoid require() inside methods

  - document all classes and methods (run PHP_CodeSniffer)

  - always implement an "empty" __construct()

  - this is a question/suggestion: You define a lot of arrays within
methods, which make methods really long, what about pushing this data in an
external file (role="data" in package.xml) and keeping it there? I don't
know how often those are updated, or how extentible they have to be.



 - autoload

  - avoid the global variable

  - (IMHO) don't make it optional, just 'require' it and use it

  - if it has to be optional, push the configurable variable inside the
class

  - use spl_register_autoload()

  - with the file structure being fixed, autoload is as simple as:

<?php

// ...

public static autoload($className)

{

    return include str_replace('_', '/', $className) . '.php';

}



 - error handler

  - make that switch/flag a configurable variable inside the class
(I18N_Arabic::$useErrorHandler)

  - make the function a public static and wrap it into the class (might
conflict otherwise)



I looked in some classes randomly, this is what I "found":



 - __call

  - document with @method tag



 - highlightText()

  - wouldn't hurt to have a default setting for $style

  - ... and a set (setStyle())

  - is hardcoding 'windows-1256' a good idea?



 - I18N_Arabic_Unicode.constants.php

  - wrap constants into class constants or class variables (to avoid
namespace clashes)



 - I18N_Arabic_Date::date()

  - use static variables so they don't get "build" each time it's being
used ($hjTxtMonth)

  - always initialize variables (e.g. $hjTxtMonth)



 - I18N_Arabic_Transliteration.class.php

  - fix file name (I18N/Arabic/Transliteration.php)

  - document your arrays -- wondering if this could improve code
readability

  - what's the difference to I18N_Arabic_Transliteration.php?



 - please add the package.xml to the repository

--
http://pear.php.net/pepr/pepr-proposal-show.php?id=617

--
PEAR Development Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PEPr] Comment on Internationalization::Arabic

by Khaled Al-Shamaa-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Thanks Till for your time, I will response every piece in your valuable
comments and do my homework

--
http://pear.php.net/pepr/pepr-proposal-show.php?id=617

--
PEAR Development Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PEPr] Comment on Internationalization::Arabic

by Khaled Al-Shamaa-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Dear PEAR members,



We know it is challenging task! We develop this library since Feb 2006 as
standalone library, and we believe that shifting it into PEAR standard
package will not be a trivial task, so please be patient and positive, and
keep feed us your comments and hints to enable us get benefit from your
experience in this process, and be sure that we will pay all needed efforts
to accomplish this task whatever time needed.



At the end of the day, we believe that enable this library as standard
PEAR package will make it one of the best resources available to the PHP
developers in Arab countries.



Best regards,

Khaled

--
http://pear.php.net/pepr/pepr-proposal-show.php?id=617

--
PEAR Development Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PEPr] Comment on Internationalization::Arabic

by David Coallier-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

2009/11/9 Khaled Al-Shamaa <khaled.alshamaa+pear@...>:

>
> Dear PEAR members,
>
> We know it is challenging task! We develop this library since Feb 2006 as
> standalone library, and we believe that shifting it into PEAR standard
> package will not be a trivial task, so please be patient and positive, and
> keep feed us your comments and hints to enable us get benefit from your
> experience in this process, and be sure that we will pay all needed efforts
> to accomplish this task whatever time needed.
>
> At the end of the day, we believe that enable this library as standard
> PEAR package will make it one of the best resources available to the PHP
> developers in Arab countries.
>
> Best regards,
> Khaled
>
> --
> http://pear.php.net/pepr/pepr-proposal-show.php?id=617
>
> --
> PEAR Development Mailing List (http://pear.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


We are definitely looking forward, and as I said before, if you need
any help, just ask. I'm sure many people would be interested in either
helping or mentoring you :)

--
Slan,
David

--
PEAR Development Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php