Closed Bug 1033185 (persian-keyboard) Opened 10 years ago Closed 9 years ago

[Keyboard][User Story] Persian keyboard

Categories

(Firefox OS Graveyard :: Gaia::Keyboard, defect, P1)

x86
Gonk (Firefox OS)
defect

Tracking

(tracking-b2g:backlog, b2g-v2.5 fixed, b2g-master fixed)

RESOLVED FIXED
tracking-b2g backlog
Tracking Status
b2g-v2.5 --- fixed
b2g-master --- fixed

People

(Reporter: bhuang, Assigned: thatoo, Mentored)

References

Details

(Whiteboard: [p=1])

User Story

As a user I would like to be able to type in Persian (sometimes call Farsi) text using a Persian keyboard layout.

Attachments

(9 files, 1 obsolete file)

This story tracks the addition of a Farsi keyboard.
feature-b2g: --- → 2.1
QA Whiteboard: [COM=SystemPlatform]
This is P1 since I think this is part of the product requirement.
Priority: -- → P1
Attached file Farsi keyboard layout (deleted) —
Keyboard layout recommendation attached.
Flags: needinfo?(s.mansoury)
Flags: needinfo?(mozilla)
Hi everyone,

Can someone please point me to the specs this work is based on? I'm looking into the XLSM file, but not sure about the details. And the data doesn't look to be aligned with any recent standards for the Persian language.

For the very basic info on Persian keyboard layouts, please check out <http://wiki.persian-computing.org/wiki/Keyboard>.

And as a side note, this language is called "Persian", not "Farsi"; similar to how the language with code ISO 639-1 code "de" is called "German" in English, not "Deutsche", nor "Allemand". See <https://groups.google.com/forum/#!topic/persian-computing/frEyd1yD7SY> for more info. This, and many other Persian-related issues are already listed in out L10n team wiki page: <https://wiki.mozilla.org/L10n:Teams:fa>.
Target Milestone: --- → 2.1 S2 (15aug)
Hi Behnam,
In the actual device display the keyboard name will be displayed in the local language (not English), does that address the concern with the name?  For example, the Bosnian layout is named "Bosanski" in the device and not the English name.

I'm not sure which specs you are referring to, the attached XLSM is a suggested layout from a partner.  It might not be the same as a desktop layout since it will have alt keys and long press keys.  The request for review is whether this layout is usable for a native speaker.
Hi Bruc,

I agree with behnam, "Persian" is the correct name of the language.Although people may search for Farsi if they do not find Persian.
In the XLSM file the main problem is that the location of the letters "پ" and "ث" doesn't make sense. 

Thank you
Flags: needinfo?(s.mansoury)
Flags: in-moztrap?(gchang)
QA Contact: gchang
Whiteboard: [2.1-feature-qa+]
Hi s.mansoury, where do you suggest those two letters to be placed then? That would be helpful if you could just modify the xlsm file and share with us, thank you!
Flags: needinfo?(s.mansoury)
Assignee: nobody → rlu
Whiteboard: [2.1-feature-qa+] → [2.1-feature-qa+], [p=1
Whiteboard: [2.1-feature-qa+], [p=1 → [2.1-feature-qa+], [p=1]
Status: NEW → ASSIGNED
The proposed layout is pretty bad and should not be implemented. We have worked hard for over a decade to main a good quality in Mozilla projects for its Persian users and having a keyboard layout like this would be a regression for this locale.

I have many questions about the requirements, which are not referenced in this bug/proposal at all. So, let me rephrase my questions:

1) How a design like this would be implemented? Could you please give me a link to another keyboard layout spec file that's already in?

2) Is there any spec for the keyboard layouts? What are the constrains of these designs?

3) To be exact, why do you expect a language to fit all their letters and some extra keys in a grid of 3x11?

4) Why there is no sign of any research on this? Have you looked at the layout being used in Android?

5) Why consistency with the standards and other (semi-) open-source projects is not being considered at all?

I know that some of these questions may have been answered somewhere already, but there's no link provided here and I'm not sure what the procedures are like these days at Mozilla, but, as the L10n team, we would like to get more info about the project when asked for feedback.
Flags: needinfo?(mozilla)
User Story: (updated)
Summary: [Keyboard][User Story] Farsi keyboard → [Keyboard][User Story] Persian keyboard
(In reply to Behnam Esfahbod [:zwnj] from comment #7)
> The proposed layout is pretty bad and should not be implemented. We have
> worked hard for over a decade to main a good quality in Mozilla projects for
> its Persian users and having a keyboard layout like this would be a
> regression for this locale.
> 
> I have many questions about the requirements, which are not referenced in
> this bug/proposal at all. So, let me rephrase my questions:
> 
> 1) How a design like this would be implemented? Could you please give me a
> link to another keyboard layout spec file that's already in?
You can reference the layouts of the other keyboard languages here:
https://github.com/mozilla-b2g/gaia/tree/master/apps/keyboard/js/layouts

It's relatively straightforward to define a new layout.

> 
> 2) Is there any spec for the keyboard layouts? What are the constrains of
> these designs?
There's a visual spec attached at bug 983043.  The constraints are not tightly defined since there are of course exceptions for different languages.

> 
> 3) To be exact, why do you expect a language to fit all their letters and
> some extra keys in a grid of 3x11?
The layout allows for more keys, but please keep in mind that if you increase the amount of keys, the actual touch area of each key becomes smaller and it will become difficult to type. 

> 
> 4) Why there is no sign of any research on this? Have you looked at the
> layout being used in Android?
We're looking for support here from native speakers of the language since different Android keyboards all have slightly different layouts.  The layout attached here is also actually a shipped layout in certain Android devices.

> 
> 5) Why consistency with the standards and other (semi-) open-source projects
> is not being considered at all?
The attached document was a suggestion, we definitely will consider standards if they can be adapted to our screen size.

Like all keyboards we have included the design direction is up for discussion.  From your feedback here it seems the attached layout is not something we would want to use.  Are there modifications to it that would make it suitable for us?  
Thanks.
Attached image Persian_keyboard_Android.png (deleted) —
I was trying to implement this, but seems we don't have consensus on the layout definition yet, so I'll just hold my patch.

BTW, just checked Android stock version of Persian keyboard, it is different from the original proposal, but also present a 3 x 11 layout, FYI.
The best solution is to have more keys on the top row as Behnam said. I can not imagine the new solutions work as Persian people have used the standard keyboard for years.
Flags: needinfo?(s.mansoury)
Going through the layout on page 29~31 in the ISIRI document in comment 3, the extra row includes the use of numerals and symbols in the shifted layout.  Note that in our keyboard design we can have a shifted layout and 2 extra symbol pages.
Is the advice just to follow the layout on the document exactly?  Is it possible to help explain the blanks and information on pages 29~31 of the document?
Flags: needinfo?(mozilla)
Hi Delphine,
Since this feature is about L10N in 2.1, I'm not sure if you are the right contact window for the testing of this feature?
Flags: needinfo?(lebedel.delphine)
Hi Gerry
Arky is head of keyboards in our team so I'll hand this over to him :)
thanks!
Flags: needinfo?(lebedel.delphine) → needinfo?(hitmanarky)
Target Milestone: 2.1 S2 (15aug) → 2.1 S3 (29aug)
RTL keyboard support is descoped from 2.1, removing feature b2g tag.
feature-b2g: 2.1 → ---
Status: ASSIGNED → NEW
Target Milestone: 2.1 S3 (29aug) → ---
Flags: in-moztrap?(gchang)
Whiteboard: [2.1-feature-qa+], [p=1] → [p=1]
Flags: in-moztrap+
Flags: needinfo?(hitmanarky)
Pike, do you know anyone who could provide suggestions on the layout in more detail or help feedback on comment 11?

Thanks.
Flags: needinfo?(l10n)
[Blocking Requested - why for this release]:

requesting as blocker since this keyboard has been requested for 2.1 Tako
blocking-b2g: --- → 2.1?
(In reply to Rudy Lu [:rudyl] from comment #16)
> Pike, do you know anyone who could provide suggestions on the layout in more
> detail or help feedback on comment 11?

Sorry, no.
Flags: needinfo?(l10n)
Triage: This is feature so not blocking. And this feature is confirmed descope from 2.1. ni Bruce and Candice to re confirm, thanks.
blocking-b2g: 2.1? → backlog
Flags: needinfo?(cserran)
Flags: needinfo?(bhuang)
yes...confirmed with partner, de-scoped for 2.1
Flags: needinfo?(cserran)
Flags: needinfo?(bhuang)
feature-b2g: --- → 2.2?
Bruce will confirm if this is a 2.2 requirement.
Flags: needinfo?(bhuang)
Talked with Bruce this is not in 2.2
feature-b2g: 2.2? → ---
Flags: needinfo?(bhuang)
blocking-b2g: backlog → ---
Assignee: rlu → nobody
Alias: persian-keyboard
How can I help here?
Will this keyboard available soon (for FFOS 2.2 or 2.5)?
I think that after initial comments and feedback from persian l10n team, no one ever answered Bruce's comment 11.
I would suggest taking it from there :)
Before reading your answer (Thanks Delphine), I tried to do something. Maybe it's completely nonsense but I tried...

I looked into github for the Arabiac keyboard and I modified the file ar.js to create fa.js.
I inspired from the android Persian keyboard (it has 10 letters instead of the FFOS 11 letters Arabic keyboard) and I asked around myself what they thought about it.
They told me that uppercase was useless but it would be better to have one more letter instead (maybe, making also an 11 letters keyboard would be good, but in Iran they still have phone with small screen so I thought 10 was more readable).
On the android Persian keyboard, a useless Arabic letter remain but a quiet usefull persian letter is missing at the same time, so they told me to exchange this two letters.
Here is the result.
https://github.com/Thatoo/gaia/blob/master/apps/keyboard/js/layouts/fa.js

Is that initiative useful? if yes, do you want that I ask my friend to help me making also an 11 letters keyboard? We could let the user choosing his keyboard (10 or 11 letters per row).
How can I add it to my FFOS 2.5 spark Nexus 5 phone?


PS : I don't understand the question in comment 11 so I won't be able to help with that.
(In reply to Thatoo from comment #25)
> Before reading your answer (Thanks Delphine), I tried to do something. Maybe
> it's completely nonsense but I tried...
> 
> I looked into github for the Arabiac keyboard and I modified the file ar.js
> to create fa.js.
> I inspired from the android Persian keyboard (it has 10 letters instead of
> the FFOS 11 letters Arabic keyboard) and I asked around myself what they
> thought about it.
> They told me that uppercase was useless but it would be better to have one
> more letter instead (maybe, making also an 11 letters keyboard would be
> good, but in Iran they still have phone with small screen so I thought 10
> was more readable).
> On the android Persian keyboard, a useless Arabic letter remain but a quiet
> usefull persian letter is missing at the same time, so they told me to
> exchange this two letters.
> Here is the result.
> https://github.com/Thatoo/gaia/blob/master/apps/keyboard/js/layouts/fa.js
> 
> Is that initiative useful? 

non-Persian speakers probably can't answer this question... you could try to conduct your own hall way testing among your friends and tell us the conclusion.

> if yes, do you want that I ask my friend to help
> me making also an 11 letters keyboard? We could let the user choosing his
> keyboard (10 or 11 letters per row).

It is preferable not to create two or more layout for the small layout difference like this unless it is necessary.

> How can I add it to my FFOS 2.5 spark Nexus 5 phone?

I am assigned this bug to you so you could see it through and check-in your completed patch. You should try figure out how to build Gaia and try out your keyboard build to show if it is really useful. There is no need to rush things -- Let's do this right on the very first time.

> PS : I don't understand the question in comment 11 so I won't be able to
> help with that.

Bruce was trying to figure out what's the right layout for the Persian users -- since none of us use Persian we would rely your help to figure out the best layout. comment 11 is probably the only thing left for him to clarify, but given the fact he has already left the project I won't mind if you start something new.

Thanks for helping out!
Assignee: nobody → thatoo
Mentor: lebedel.delphine, timdream
Status: NEW → ASSIGNED
Thank you for this honour to assign me this task, I'll try to do my best 

I made a second layout file for a persian keyboard based on 11 letters width.
As soon as I manage to add them to my phone, I'll make my friends try them and decide what is the best.

The 10 letters Persian keyboard : https://github.com/Thatoo/gaia/blob/master/apps/keyboard/js/layouts/fa-10.js
The 10 letters Persian keyboard : https://github.com/Thatoo/gaia/blob/master/apps/keyboard/js/layouts/fa-11.js
I forgot to ask, could you check them and tell me if something is obviously wrong because there are some line that I copied from other keyboard layout without knowing what they mean such as
  secondLayout: true,
  specificCssRule: true,
  types: ['text', 'url', 'email'],
  autoCorrectLanguage: 'fa',
  alternateLayoutKey: '123',
  basicLayoutKey: 'أ ب ج',

Thank you,
The quicker way to find the answers would be try to grep the code or find it on mxr.mozilla.org.

(In reply to Thatoo from comment #28)
> I forgot to ask, could you check them and tell me if something is obviously
> wrong because there are some line that I copied from other keyboard layout
> without knowing what they mean such as
>   secondLayout: true,

This line is now meaningless, but you should set it to true for consistency.

>   specificCssRule: true,

See http://mxr.mozilla.org/gaia/source/apps/keyboard/style/keyboard.css#725

>   types: ['text', 'url', 'email'],

This should be kept, indicating Persian alphabets are good for these input types (and not good for, say, "number")

>   autoCorrectLanguage: 'fa',

Remove this line unless there is a dictionary available. I don't think spellcheck or word suggestion applies to Persian for now.

>   alternateLayoutKey: '123',

This is the label of the second layout page (the symbols), you don't need to change the label if you are not creating an special symbol layout page for Persian. 

>   basicLayoutKey: 'أ ب ج',

This is the label of the button for going back to the alphabets layout from the symbol layout.
Thank you!
I made the appropriate changes.
(In reply to Tim Guan-tin Chien [:timdream] (slow response; please ni? to queue) from comment #26)
> (In reply to Thatoo from comment #25)
> > How can I add it to my FFOS 2.5 spark Nexus 5 phone?
> 
> I am assigned this bug to you so you could see it through and check-in your
> completed patch. You should try figure out how to build Gaia and try out
> your keyboard build to show if it is really useful. There is no need to rush
> things -- Let's do this right on the very first time.
> 
I asked Vosky, the guy who is making the build for the Nexus 5 on xda dev forum and he accepted to add my two keyboard. (http://forum.xda-developers.com/google-nexus-5/development/nightly-firefox-os-t2960953/)
However, everytime he tries to build it, it failed. (https://framabin.org/?bfae46b37d77cc10#84MwTkMVHWGpsAH9hb6Sgw8tqKtsZS7iNd468zPNqq4=)

How can we solve the problem?
I guess, everything in this sentence
"[failed] building keyboard app failed with exit code 1"
but it's very mysterious....
(In reply to Thatoo from comment #32)
> I guess, everything in this sentence
> "[failed] building keyboard app failed with exit code 1"
> but it's very mysterious....

You should try to build and flash the keyboard app without build the entire phone yourself. It would be more efficient for you to do that than asking some one else to try out your patch.

The log here is clipped; there should be some other error message on before that line. You could find the log without going through the entire log by issue command that would only build Gaia in your work directory.

(In reply to Thatoo from comment #33)
> I change the first line, Keyboards['fa-10'] = { or Keyboards['fa-11'] = {
> in 
> https://github.com/Thatoo/gaia/blob/master/apps/keyboard/js/layouts/fa-10.js
> and
> https://github.com/Thatoo/gaia/blob/master/apps/keyboard/js/layouts/fa-11.js
> 

This is probably where the error is. The id must be the same with the file name.

> and I add 
>  "fa" : "فارس",
> in
> https://github.com/Thatoo/gaia/blob/master/locales/languages_all.json
> and
> https://github.com/Thatoo/gaia/blob/master/locales/languages_dev.json

This won't help, localization is not related to keyboard functionality.
> I hope that will help
"You should try to build and flash the keyboard app only..."
I have no idea how to do that... Where to start? Is there a Mozilla Dev wiki that answer question about it?
(In reply to Thatoo from comment #35)
> "You should try to build and flash the keyboard app only..."
> I have no idea how to do that... Where to start? Is there a Mozilla Dev wiki
> that answer question about it?

https://github.com/mozilla-b2g/gaia#hacking-gaia and links
I followed https://github.com/mozilla-b2g/gaia#hacking-gaia, I end up following https://github.com/timdream/gaia-keyboard-demo.git but the download of Gaia never finished and my internet being limited (I'm in Iran), I can't try and try again.
I tried also to find out how to at least test on WebIDE but I couldn't find that neither.
I finally decided to hope everything was fine now and I made a pull request for my two Persian keyboard.
I hope Vosky will manage to add them to his next build because "flashing the keyboard app" only doesn't seem to be as easy as writting it, or I missed the paragraph that was talking about it.
(In reply to Thatoo from comment #37)
> I followed https://github.com/mozilla-b2g/gaia#hacking-gaia, I end up
> following https://github.com/timdream/gaia-keyboard-demo.git but the
> download of Gaia never finished and my internet being limited (I'm in Iran),
> I can't try and try again.
> I tried also to find out how to at least test on WebIDE but I couldn't find
> that neither.

Sorry to hear that.

> I finally decided to hope everything was fine now and I made a pull request
> for my two Persian keyboard.
> I hope Vosky will manage to add them to his next build because "flashing the
> keyboard app" only doesn't seem to be as easy as writting it, or I missed
> the paragraph that was talking about it.

I can try to loaded up these layouts too, assuming comment 27 is indeed the right layout needed for Persian. Vosky could beat me to it if I don't come back with my findings in time.
Thank you!
The last "git submodule update" reach 97% and I was so excited but then failed... Is there a way to download by torrent or by uget?
I made a pull request on master and calendar-v3.0 branches because I didn't know which one was the good one.
If you make them work then, I can explain to Vosky and he can add them in his build. Finally I'll make all my friend try both of them.
(In reply to Thatoo from comment #39)
> Thank you!
> The last "git submodule update" reach 97% and I was so excited but then
> failed... Is there a way to download by torrent or by uget?
> I made a pull request on master and calendar-v3.0 branches because I didn't
> know which one was the good one.
> If you make them work then, I can explain to Vosky and he can add them in
> his build. Finally I'll make all my friend try both of them.

Unfortunately GitHub offer alternative download options to a workable git repo. You could do a git shadow clone but you won't be able to submit pull request with it.
So the layouts can be built correctly, except that a |width: 11| property is needed for fa-11.js so it could layout the width of the keys. I've also add some additional style changes for the layouts, on top of bug 1203455.

I am uploading screenshots shortly. After that I will get some second opinions on these layouts -- I think we are good to go here.
Depends on: 1203455
That looks just great!
Thank you so much  Tim Guan-tin Chien.
I can't wait trying them on my phone and ask feedback from my Iranian friends to select which one is the best.
Then, later in the year, when I'll know more than "dad went from home to his office' in Persian, I'll start translating FFOS and work on the lexicon.
I have them on my phone now and I have asked my Iranian friends and teachers to play with it.
Feedbacks are good, people like them, but not so usefull. Some prefer bigger letters so the 10, others prefer to visualize more letters so the 11.
It seems like I have to wait the lexicon before taking a decision (probably then in favor of 10).

An interesting suggestion was to offer two keyboards, the 10 for portrait display and make a 12 even (instead of 11 which would show all letters) for tablets or landscape display on phone. What do you think?

I'm working first on the lexicon then I'll finalize all that.
(In reply to Thatoo from comment #46)
> I have them on my phone now and I have asked my Iranian friends and teachers
> to play with it.
> Feedbacks are good, people like them, but not so usefull. Some prefer bigger
> letters so the 10, others prefer to visualize more letters so the 11.
> It seems like I have to wait the lexicon before taking a decision (probably
> then in favor of 10).
> 
> An interesting suggestion was to offer two keyboards, the 10 for portrait
> display and make a 12 even (instead of 11 which would show all letters) for
> tablets or landscape display on phone. What do you think?
> 

The keyboard app does not support that yet. You are welcome to patch though.

> I'm working first on the lexicon then I'll finalize all that.

The problem is not about having a word list. Our existing suggestion/correcting logic might not be having the right assumptions for the Persian alphabets to give out a meaningful result.

It's fine with me if you decide not to land the layout before having a useful suggestion/correction though.
Here is the xml file I have manage to make, as a list of persian word, based on wikipedia pages, Thanks to Behnam works, https://github.com/behnam/persian-words-frequency :

https://framadrop.org/r/0HWNe-9ZMk#JkWZubjkSAdshDRbHkr6uf85bwt7UaKjQk6I8/pZfb0=

From this page, https://developer.mozilla.org/en-US/Firefox_OS/Developing_Gaia/Customizing_the_keyboard , they say that I should do one more step to make the lexicon :

Building the files

Once you have the js and the lexicon file, go in this gaia directory and open Makefile. Append the name of your dictionary to the list (e.g., if it's called gd_wordlist.xml), put:

ga.dict \
gd.dict \

Make sure the gd_worldlist.xml file is in the folder and run $ make gd.dict

If you have gotten this far but get stuck at the last step of building the .dict file, file a bug (Component: Gaia Keyboard) and attach your files and explain what the problem is. Someone should be able to help. Make sure to submit the patch as a pull request, and flag for review to someone, otherwise the bug will be likely unattended.

Does anyone can do it?
(In reply to Thatoo from comment #48)

Yes, that's exactly what you could try, although again, we are not sure if the current suggestion logic can work with Persian. The only way to find out is to try.
I finally manage to download the github repo for gaia. and I tried to make the dict but

yogo@yogo-ordi:~/git/gaia-keyboard-demo/gaia/apps/keyboard/js/imes/latin/dictionaries$ sudo make fa.dict
npm install
npm WARN package.json @ No repository field.
npm WARN package.json @ No license field.
node --harmony xml2dict.js -o fa.dict fa_wordlist.xml
Reading XML file...
Parsing XML file...
Finished parsing.
Generating TST Tree...
events.js:141
      throw er; // Unhandled 'error' event
      ^

TypeError: Cannot read property 'length' of undefined
    at null.<anonymous> (/home/yogo/git/gaia-keyboard-demo/gaia/apps/keyboard/js/settings/word_list_converter.js:249:59)
    at Array.forEach (native)
    at TSTBuilder.build (/home/yogo/git/gaia-keyboard-demo/gaia/apps/keyboard/js/settings/word_list_converter.js:244:14)
    at WordListConverter.toBlob (/home/yogo/git/gaia-keyboard-demo/gaia/apps/keyboard/js/settings/word_list_converter.js:560:14)
    at /home/yogo/git/gaia-keyboard-demo/gaia/apps/keyboard/js/imes/latin/dictionaries/xml2dict.js:118:43
    at Parser.<anonymous> (/home/yogo/git/gaia-keyboard-demo/gaia/apps/keyboard/js/imes/latin/dictionaries/node_modules/xml2js/lib/xml2js.js:483:18)
    at emitOne (events.js:77:13)
    at Parser.emit (events.js:169:7)
    at Object.onclosetag (/home/yogo/git/gaia-keyboard-demo/gaia/apps/keyboard/js/imes/latin/dictionaries/node_modules/xml2js/lib/xml2js.js:444:26)
    at emit (/home/yogo/git/gaia-keyboard-demo/gaia/apps/keyboard/js/imes/latin/dictionaries/node_modules/xml2js/node_modules/sax/lib/sax.js:639:35)
    at emitNode (/home/yogo/git/gaia-keyboard-demo/gaia/apps/keyboard/js/imes/latin/dictionaries/node_modules/xml2js/node_modules/sax/lib/sax.js:644:5)
make: *** [fa.dict] Erreur 1
yogo@yogo-ordi:~/git/gaia-keyboard-demo/gaia/apps/keyboard/js/imes/latin/dictionaries$ 

By the way, I did a mistake because I guess I downloaded the original github repo of gaia not my fork of it, so I don't know now how I can send my file fa_worldlist.xml on github...
(In reply to Thatoo from comment #50)
> I finally manage to download the github repo for gaia. and I tried to make
> the dict but
> 
> yogo@yogo-ordi:~/git/gaia-keyboard-demo/gaia/apps/keyboard/js/imes/latin/
> dictionaries$ sudo make fa.dict
> npm install
> npm WARN package.json @ No repository field.
> npm WARN package.json @ No license field.
> node --harmony xml2dict.js -o fa.dict fa_wordlist.xml
> Reading XML file...
> Parsing XML file...
> Finished parsing.
> Generating TST Tree...
> events.js:141
>       throw er; // Unhandled 'error' event
>       ^
> 
> TypeError: Cannot read property 'length' of undefined
>     at null.<anonymous>
> (/home/yogo/git/gaia-keyboard-demo/gaia/apps/keyboard/js/settings/
> word_list_converter.js:249:59)
>     at Array.forEach (native)
>     at TSTBuilder.build
> (/home/yogo/git/gaia-keyboard-demo/gaia/apps/keyboard/js/settings/
> word_list_converter.js:244:14)
>     at WordListConverter.toBlob
> (/home/yogo/git/gaia-keyboard-demo/gaia/apps/keyboard/js/settings/
> word_list_converter.js:560:14)
>     at
> /home/yogo/git/gaia-keyboard-demo/gaia/apps/keyboard/js/imes/latin/
> dictionaries/xml2dict.js:118:43
>     at Parser.<anonymous>
> (/home/yogo/git/gaia-keyboard-demo/gaia/apps/keyboard/js/imes/latin/
> dictionaries/node_modules/xml2js/lib/xml2js.js:483:18)
>     at emitOne (events.js:77:13)
>     at Parser.emit (events.js:169:7)
>     at Object.onclosetag
> (/home/yogo/git/gaia-keyboard-demo/gaia/apps/keyboard/js/imes/latin/
> dictionaries/node_modules/xml2js/lib/xml2js.js:444:26)
>     at emit
> (/home/yogo/git/gaia-keyboard-demo/gaia/apps/keyboard/js/imes/latin/
> dictionaries/node_modules/xml2js/node_modules/sax/lib/sax.js:639:35)
>     at emitNode
> (/home/yogo/git/gaia-keyboard-demo/gaia/apps/keyboard/js/imes/latin/
> dictionaries/node_modules/xml2js/node_modules/sax/lib/sax.js:644:5)
> make: *** [fa.dict] Erreur 1
> yogo@yogo-ordi:~/git/gaia-keyboard-demo/gaia/apps/keyboard/js/imes/latin/
> dictionaries$ 
> 

What's your npm and node version? The code was done around the time of node v0.10 or v0.12-ish so |npm install| might giving you the broken combinations here.

Alternatively, if you could tell me the versions of you npm and node I might be able to fix it in another bug accordingly.

> By the way, I did a mistake because I guess I downloaded the original github
> repo of gaia not my fork of it, so I don't know now how I can send my file
> fa_worldlist.xml on github...

No need to re-download. You could just add a new remote and point that to your fork. Assuming your |git remote -v| is currently:

origin https://github.com/mozilla-b2g/gaia.git (fetch)
origin https://github.com/mozilla-b2g/gaia.git (push)

You should do 

git remote rename origin upstream

and

git remote add origin https://github.com/<your GitHub username>/gaia.git

and the end result of |git remote -v| would be

origin https://github.com/<username>/gaia.git (fetch)
origin https://github.com/<username>/gaia.git (push)
upstream https://github.com/mozilla-b2g/gaia.git (fetch)
upstream https://github.com/mozilla-b2g/gaia.git (push)

with that, you should pull the latest master commits with |git pull upstream master| when on master, and submit a pull request by create a feature branch and push it to your fork with |git push origin <feature branch name>|.

If the problem persists I can surely offer some personal help by push something you uploaded on Bugzilla to GitHub for you, if that's easier.
Well, I don't have npm neither node. I've installed nodejs 4.2.2 instead.
On Ubuntu 14.04, on Synaptic, I can install npm 1.3.10 and node 1.3.2. Should I do that? I tried before but then the process was not even starting, I had error right at the beginning, so I found on some forum that I should try to install nodejs instead which I did and it need to uninstall npm and node.
Hi guys,

I'm Arash from l10n Persian team (http://wiki.mozilla.org/L10n:Teams:fa). After we successfully completed translations of FirefoxOS, I was thinking about working on a Persian keyboard (and I was) when actually Delphine told me that there's an ongoing activity on this bug (sorry, I should have searched first).

Thanks Thatoo for spending time on this and making a great effort! The keyboard Thatoo has designed is fine but it lacks some important characters. First it doesn't have Persian numbers (it doesn't have the Numbers page at all), the zwnj character which is important is not added and also most of punctuation are missing.

I made another more complete layout which I'm gonna discuss about it with our team in mailing list (I'll CC Thatoo on that so he/she can join us) and will send a pull request on gaia in a day or two.

Is this fine with you guys?

Thanks
sure, of course it is fine for me. I'm even happy to read you!
This Persian keyboard was my first real contribution to the free software community so it was important to me that it goes somewhere, and it did but I understand that it is incomplete so I'll be very happy to have a better one on my pocket computer.
Will it be integrated, as well as the Farsi translations, in FFOS 2.5 ROM?
I can't wait to show my pocket computer to my friends fully translated in Persian.

By the way, what is zwnj character?
I didn't put the Persian number because my friends told me that on their pocket computer they use European numbers. However, I asked again today and they said that they don't use it because Android doesn't provide (or did not and they get used to it).
(In reply to Arash Mousavi from comment #53)
> Hi guys,
> 
> I'm Arash from l10n Persian team (http://wiki.mozilla.org/L10n:Teams:fa).
> After we successfully completed translations of FirefoxOS, I was thinking
> about working on a Persian keyboard (and I was) when actually Delphine told
> me that there's an ongoing activity on this bug (sorry, I should have
> searched first).
> 
> Thanks Thatoo for spending time on this and making a great effort! The
> keyboard Thatoo has designed is fine but it lacks some important characters.
> First it doesn't have Persian numbers (it doesn't have the Numbers page at
> all), the zwnj character which is important is not added and also most of
> punctuation are missing.
> 
> I made another more complete layout which I'm gonna discuss about it with
> our team in mailing list (I'll CC Thatoo on that so he/she can join us) and
> will send a pull request on gaia in a day or two.
> 
> Is this fine with you guys?
> 
> Thanks

Hi Arash,
Great idea,

Could you please give me a link from new keyboard repo?

I thought Android keyboard best guide for design specific button and alternative key what's your comment about it?

Bests,
Reza
(In reply to Thatoo from comment #54)
> sure, of course it is fine for me. I'm even happy to read you!
> This Persian keyboard was my first real contribution to the free software
> community so it was important to me that it goes somewhere, and it did but I
> understand that it is incomplete so I'll be very happy to have a better one
> on my pocket computer.
> Will it be integrated, as well as the Farsi translations, in FFOS 2.5 ROM?
> I can't wait to show my pocket computer to my friends fully translated in
> Persian.
> 
> By the way, what is zwnj character?
> I didn't put the Persian number because my friends told me that on their
> pocket computer they use European numbers. However, I asked again today and
> they said that they don't use it because Android doesn't provide (or did not
> and they get used to it).

Hi,
please check this link about ZWNJ:

https://en.wikipedia.org/wiki/Zero-width_non-joiner

Bests,
Reza, L10n-fa
I just sent a pull request on Github[1]. This is the final version of the layout that we made and discussed in dev-l10n-fa[2].

[1] https://github.com/mozilla-b2g/gaia/pull/33304
[2] https://groups.google.com/forum/#!topic/mozilla.dev.l10n.fa/8949llyoLwA
Attachment #8690239 - Attachment is obsolete: true
Arash,

I am glad the progress has been made while I was away! So as long as you are all happy with the layout I can surely R+ it.
I however found a small issue with the patch -- https://github.com/mozilla-b2g/gaia/pull/33304#discussion_r46015569 this is probably a find-and-replace error that should be corrected.

There are also some other formatting issue (commented on GitHub too).

Please also read the bug since the previous discussion about this was that the layout should be completed with auto-suggestion.... I am not sure if that's a position you have already moved away from. If so we can check-in the layout first.
Flags: needinfo?(mousavi.arash)
Attached image alts.png (deleted) —
Tim,

Thanks for your review. About the alt keys on first layout, I'm actually defining alternative for 'ص' not numbers, but browser is trying to be smart about RTL and LTR direction on same line and making a mess. Those actually looks like the "alts.png" attachment in VIM.

I fixed the the code for the other comment.
Flags: needinfo?(mousavi.arash)
Oh I forgot about the dictionary, Kevin Scannell on our mailing list mentioned that there's an issue with autocorrect engine not working for Perso-Arabic script and I can't see one for Arabic too. I add Ahmed ans see if he can give us more info about this.
Flags: needinfo?(nefzaoui)
(In reply to Arash Mousavi [:Arash-M] from comment #62)
> Tim,
> 
> Thanks for your review. About the alt keys on first layout, I'm actually
> defining alternative for 'ص' not numbers, but browser is trying to be smart
> about RTL and LTR direction on same line and making a mess. Those actually
> looks like the "alts.png" attachment in VIM.
> 
> I fixed the the code for the other comment.

Ah, make sense. Thanks for the explanation. It looks good now.
So, is this keyboard included in latest released of FFOS 2.5?
About autocorrect engine, is there a small adaptation to make for Perso-Arabic (is it coming?) or does it need a complete rewriting?
(In reply to Thatoo from comment #65)
> So, is this keyboard included in latest released of FFOS 2.5?
> About autocorrect engine, is there a small adaptation to make for
> Perso-Arabic (is it coming?) or does it need a complete rewriting?

Arash has not submit the pull request for review so I have not officially r+ and merge it.

Again, it is also unclear to me (from the discussion here) whether or not you want to wait for auto correction to complete before introducing the layout into Gaia or not.
(In reply to Tim Guan-tin Chien [:timdream] (please needinfo) from comment #66)
> 
> Arash has not submit the pull request for review so I have not officially r+
> and merge it.

How should I do that? I have already sent the pull request. The latest change you wanted was ordering the CSS style which is done and I commented on Github. It would be cool if you give me further instructions.

> Again, it is also unclear to me (from the discussion here) whether or not
> you want to wait for auto correction to complete before introducing the
> layout into Gaia or not.

I think the auto correct shouldn't be a blocker for merging the keyboard. I guess there are already other locales without auto correct and we can follow that in another bug maybe.
Attachment #8690241 - Flags: review?(timdream)
I agree with Arash, we could take care of the auto-correct in a second bug. I won't try again to do aomething about it before Christmas but having the keyboard in the FFOS 2.5 released, that would be nice.
Comment on attachment 8690241 [details]
[gaia] arash-m:keyboard-persian > mozilla-b2g:master

I'll merge it into master now after fixing GB test failure.

[Approval Request Comment]
[Bug caused by] (feature/regressing bug #): feature
[User impact] if declined: Unable to input Persian alphabets.
[Testing completed]: completed manually by the contributor.
[Risk to taking this patch] (and alternatives if risky): The layout definition is isolated in it's def file. As long as there isn't any syntax error there shouldn't be any impact to other features.
[String changes made]: none.
Attachment #8690241 - Flags: review?(timdream)
Attachment #8690241 - Flags: review+
Attachment #8690241 - Flags: approval-gaia-v2.5?
Filed bug 1230445 for auto correct and suggestions.
Flags: needinfo?(nefzaoui)
(In reply to Tim Guan-tin Chien [:timdream] (please needinfo) from comment #73)
> The keyboard demo page is updated: http://timdream.org/gaia-keyboard-demo/#fa

Thanks @timdream. This makes it easier for communities to provide feedback on keyboard and dictionaries.
Comment on attachment 8690241 [details]
[gaia] arash-m:keyboard-persian > mozilla-b2g:master

Approving for 2.5 uplift. 

Thanks
Attachment #8690241 - Flags: approval-gaia-v2.5? → approval-gaia-v2.5+
Tim, so does your commit need to merged to 2.5 ?
Flags: needinfo?(timdream)
(In reply to Carsten Book [:Tomcat] from comment #76)
> Tim, so does your commit need to merged to 2.5 ?

Uplift this to v2.5 will help Persian dogfood users who stay on that channel. We could try but I don't want to spend time on this if it can't be merged.
Flags: needinfo?(timdream)
(In reply to Tim Guan-tin Chien [:timdream] (please needinfo) from comment #77)
> (In reply to Carsten Book [:Tomcat] from comment #76)
> > Tim, so does your commit need to merged to 2.5 ?
> 
> Uplift this to v2.5 will help Persian dogfood users who stay on that
> channel. We could try but I don't want to spend time on this if it can't be
> merged.

Hi Tim,
Feel free to let me know if you need any collaboration from Persian Team in this matter.
Hello all,

I don't understand if the persian keyboard is now merged or not?
If I update the rom of my FFOS, will the persian keyboard available?
And, if I update the rom, will the persian translation of FFOS done by the L10n team?

Thank you to all who worked on this subject,
Thatoo
(In reply to Thatoo from comment #79)
> I don't understand if the persian keyboard is now merged or not?
> If I update the rom of my FFOS, will the persian keyboard available?
> And, if I update the rom, will the persian translation of FFOS done by the
> L10n team?

I'm sure that it's available on 2.6 and I'm using both the keyboard and the translations. However about 2.5, it seems that Persian is available as UI language, but keyboard is not yet uplifted.
Hi all - this has been approved for uplift on 2.5 by RelMan on comment 75. Has anything prevented us from moving forward? I'm a bit confused by the comments TBH
aha, so that's it! was confused myself. Thanks Tim :)
Flags: needinfo?(mozilla)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: