Merge lp:~arashbm/ubuntu-keyboard/persian-layout into lp:ubuntu-keyboard
- persian-layout
- Merge into trunk
Proposed by
Arash Badie Modiri
Status: | Work in progress |
---|---|
Proposed branch: | lp:~arashbm/ubuntu-keyboard/persian-layout |
Merge into: | lp:ubuntu-keyboard |
Diff against target: |
718 lines (+656/-0) 10 files modified
plugins/fa/fa.pro (+9/-0) plugins/fa/qml/Keyboard_fa.qml (+131/-0) plugins/fa/qml/Keyboard_fa_email.qml (+145/-0) plugins/fa/qml/Keyboard_fa_url.qml (+127/-0) plugins/fa/qml/Keyboard_fa_url_search.qml (+145/-0) plugins/fa/qml/qml.pro (+20/-0) plugins/fa/src/persianplugin.h (+25/-0) plugins/fa/src/persianplugin.json (+7/-0) plugins/fa/src/src.pro (+46/-0) plugins/plugins.pro (+1/-0) |
To merge this branch: | bzr merge lp:~arashbm/ubuntu-keyboard/persian-layout |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Michael Sheldon (community) | Needs Fixing | ||
Review via email: mp+236248@code.launchpad.net |
Commit message
Add Persian keyboard layout plugin.
Description of the change
I created Persian (fa) layout based on Arabic and Serbian plugins. Unfortunately I couldn't find any references on how to build and use my local branch on emulator so I'm submitting this merge proposal as a request for comments for now.
Anyone can refer me to any sorts of documentation on how can I test this branch?
The main defferece between this and Arabic layout is presence of ZWNJ (http://
To post a comment you must log in.
Unmerged revisions
- 230. By Arash Badie Modiri
-
styling changes
- 229. By Arash Badie Modiri
-
added persian keyboard
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === added directory 'plugins/fa' |
2 | === added file 'plugins/fa/fa.pro' |
3 | --- plugins/fa/fa.pro 1970-01-01 00:00:00 +0000 |
4 | +++ plugins/fa/fa.pro 2014-09-28 10:04:07 +0000 |
5 | @@ -0,0 +1,9 @@ |
6 | +CONFIG += ordered |
7 | +TEMPLATE = subdirs |
8 | +SUBDIRS = \ |
9 | + src \ |
10 | + qml |
11 | + |
12 | +QMAKE_EXTRA_TARGETS += check |
13 | +check.target = check |
14 | +check.CONFIG = recursive |
15 | |
16 | === added directory 'plugins/fa/qml' |
17 | === added file 'plugins/fa/qml/Keyboard_fa.qml' |
18 | --- plugins/fa/qml/Keyboard_fa.qml 1970-01-01 00:00:00 +0000 |
19 | +++ plugins/fa/qml/Keyboard_fa.qml 2014-09-28 10:04:07 +0000 |
20 | @@ -0,0 +1,131 @@ |
21 | +/* |
22 | + * Copyright 2013 Canonical Ltd. |
23 | + * |
24 | + * This program is free software; you can redistribute it and/or modify |
25 | + * it under the terms of the GNU Lesser General Public License as published by |
26 | + * the Free Software Foundation; version 3. |
27 | + * |
28 | + * This program is distributed in the hope that it will be useful, |
29 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
30 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
31 | + * GNU Lesser General Public License for more details. |
32 | + * |
33 | + * You should have received a copy of the GNU Lesser General Public License |
34 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
35 | + */ |
36 | + |
37 | +import QtQuick 2.0 |
38 | +import "../../keys" |
39 | +import "../../keys/key_constants.js" as UI |
40 | + |
41 | +KeyPad { |
42 | + anchors.fill: parent |
43 | + |
44 | + content: c1 |
45 | + symbols: "languages/Keyboard_symbols.qml" |
46 | + |
47 | + Column { |
48 | + id: c1 |
49 | + anchors.fill: parent |
50 | + spacing: 0 |
51 | + |
52 | + Row { |
53 | + anchors.horizontalCenter: parent.horizontalCenter; |
54 | + spacing: 0 |
55 | + |
56 | + CharKey { label: "ض"; extended: ["۱", "1"]; } |
57 | + CharKey { label: "ص"; extended: ["۲", "2"]; } |
58 | + CharKey { label: "ث"; extended: ["۳", "3"]; } |
59 | + CharKey { label: "ق"; extended: ["۴", "4"]; } |
60 | + CharKey { label: "ف"; extended: ["۵", "5"]; } |
61 | + CharKey { label: "غ"; extended: ["۶", "6"]; } |
62 | + CharKey { label: "ع"; extended: ["۷", "7"]; } |
63 | + CharKey { label: "ه"; extended: ["۸", "8"]; } |
64 | + CharKey { label: "خ"; extended: ["۹", "9"]; } |
65 | + CharKey { label: "ح"; extended: ["۰", "0"]; } |
66 | + CharKey { label: "ج";} |
67 | + } |
68 | + |
69 | + Row { |
70 | + anchors.horizontalCenter: parent.horizontalCenter; |
71 | + spacing: 0 |
72 | + |
73 | + CharKey { label: "ش"; } |
74 | + CharKey { label: "س"; } |
75 | + CharKey { label: "ی"; extended: ["ئ", "ي"]; } |
76 | + CharKey { label: "ب"; } |
77 | + CharKey { label: "ل"; } |
78 | + CharKey { label: "ا"; extended: ["آ", "أ". "إ"] } |
79 | + CharKey { label: "ت"; extended: ["ة"]; } |
80 | + CharKey { label: "ن"; } |
81 | + CharKey { label: "م"; } |
82 | + CharKey { label: "ک";; } |
83 | + CharKey { label: "گ"; } |
84 | + } |
85 | + |
86 | + Row { |
87 | + anchors.horizontalCenter: parent.horizontalCenter; |
88 | + spacing: 0 |
89 | + |
90 | + CharKey { label: "ظ"; } |
91 | + CharKey { label: "ط"; } |
92 | + CharKey { label: "ژ"; } |
93 | + CharKey { label: "ز"; } |
94 | + CharKey { label: "ر"; } |
95 | + CharKey { label: "ذ"; } |
96 | + CharKey { label: "د"; } |
97 | + CharKey { label: "پ"; } |
98 | + CharKey { label: "و"; } |
99 | + CharKey { label: "چ"; } |
100 | + BackspaceKey { padding: 0 } |
101 | + } |
102 | + |
103 | + Item { |
104 | + anchors.left: parent.left |
105 | + anchors.right: parent.right |
106 | + height: panel.keyHeight + units.gu(UI.row_margin); |
107 | + |
108 | + SymbolShiftKey { id: symShiftKey; anchors.left: parent.left; height: parent.height; } |
109 | + LanguageKey { |
110 | + id: languageMenuButton; |
111 | + anchors.left: symShiftKey.right; |
112 | + height: parent.height; |
113 | + } |
114 | + |
115 | + CharKey { |
116 | + id: commaKey; |
117 | + label: "،"; |
118 | + anchors.left: languageMenuButton.right; |
119 | + height: parent.height; |
120 | + } |
121 | + |
122 | + SpaceKey { |
123 | + id: spaceKey; |
124 | + anchors.left: commaKey.right; |
125 | + anchors.right: zwnjKey.left; noMagnifier: true; |
126 | + height: parent.height; |
127 | + } |
128 | + |
129 | + CharKey { |
130 | + id: zwnjKey; |
131 | + label: ""; |
132 | + anchors.right: dotKey.left; |
133 | + height: parent.height; |
134 | + } |
135 | + |
136 | + CharKey { |
137 | + id: dotKey; |
138 | + label: "."; |
139 | + extended: ["؟", "!"]; |
140 | + anchors.right: enterKey.left; |
141 | + height: parent.height; |
142 | + } |
143 | + |
144 | + ReturnKey { |
145 | + id: enterKey; |
146 | + anchors.right: parent.right; |
147 | + height: parent.height; |
148 | + } |
149 | + } |
150 | + } // column |
151 | +} |
152 | |
153 | === added file 'plugins/fa/qml/Keyboard_fa_email.qml' |
154 | --- plugins/fa/qml/Keyboard_fa_email.qml 1970-01-01 00:00:00 +0000 |
155 | +++ plugins/fa/qml/Keyboard_fa_email.qml 2014-09-28 10:04:07 +0000 |
156 | @@ -0,0 +1,145 @@ |
157 | +/* |
158 | + * Copyright 2013 Canonical Ltd. |
159 | + * |
160 | + * This program is free software; you can redistribute it and/or modify |
161 | + * it under the terms of the GNU Lesser General Public License as published by |
162 | + * the Free Software Foundation; version 3. |
163 | + * |
164 | + * This program is distributed in the hope that it will be useful, |
165 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
166 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
167 | + * GNU Lesser General Public License for more details. |
168 | + * |
169 | + * You should have received a copy of the GNU Lesser General Public License |
170 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
171 | + */ |
172 | + |
173 | +import QtQuick 2.0 |
174 | +import "../../keys" |
175 | +import "../../keys/key_constants.js" as UI |
176 | + |
177 | +KeyPad { |
178 | + anchors.fill: parent |
179 | + |
180 | + content: c1 |
181 | + symbols: "languages/Keyboard_symbols.qml" |
182 | + |
183 | + Column { |
184 | + id: c1 |
185 | + anchors.fill: parent |
186 | + spacing: 0 |
187 | + |
188 | + Row { |
189 | + anchors.horizontalCenter: parent.horizontalCenter; |
190 | + spacing: 0 |
191 | + |
192 | + CharKey { label: "ض"; extended: ["۱", "1"]; } |
193 | + CharKey { label: "ص"; extended: ["۲", "2"]; } |
194 | + CharKey { label: "ث"; extended: ["۳", "3"]; } |
195 | + CharKey { label: "ق"; extended: ["۴", "4"]; } |
196 | + CharKey { label: "ف"; extended: ["۵", "5"]; } |
197 | + CharKey { label: "غ"; extended: ["۶", "6"]; } |
198 | + CharKey { label: "ع"; extended: ["۷", "7"]; } |
199 | + CharKey { label: "ه"; extended: ["۸", "8"]; } |
200 | + CharKey { label: "خ"; extended: ["۹", "9"]; } |
201 | + CharKey { label: "ح"; extended: ["۰", "0"]; } |
202 | + CharKey { label: "ج";} |
203 | + } |
204 | + |
205 | + Row { |
206 | + anchors.horizontalCenter: parent.horizontalCenter; |
207 | + spacing: 0 |
208 | + |
209 | + CharKey { label: "ش"; } |
210 | + CharKey { label: "س"; } |
211 | + CharKey { label: "ی"; extended: ["ئ", "ي"]; } |
212 | + CharKey { label: "ب"; } |
213 | + CharKey { label: "ل"; } |
214 | + CharKey { label: "ا"; extended: ["آ", "أ". "إ"] } |
215 | + CharKey { label: "ت"; extended: ["ة"]; } |
216 | + CharKey { label: "ن"; } |
217 | + CharKey { label: "م"; } |
218 | + CharKey { label: "ک";; } |
219 | + CharKey { label: "گ"; } |
220 | + |
221 | + } |
222 | + |
223 | + Row { |
224 | + anchors.horizontalCenter: parent.horizontalCenter; |
225 | + spacing: 0 |
226 | + CharKey { label: "ظ"; } |
227 | + CharKey { label: "ط"; } |
228 | + CharKey { label: "ژ"; } |
229 | + CharKey { label: "ز"; } |
230 | + CharKey { label: "ر"; } |
231 | + CharKey { label: "ذ"; } |
232 | + CharKey { label: "د"; } |
233 | + CharKey { label: "پ"; } |
234 | + CharKey { label: "و"; } |
235 | + CharKey { label: "چ"; } |
236 | + BackspaceKey { padding: 0 } |
237 | + } |
238 | + |
239 | + Item { |
240 | + anchors.left: parent.left |
241 | + anchors.right: parent.right |
242 | + |
243 | + height: panel.keyHeight + units.gu(UI.row_margin); |
244 | + |
245 | + SymbolShiftKey { |
246 | + id: symShiftKey; |
247 | + anchors.left: parent.left; |
248 | + height: parent.height; |
249 | + } |
250 | + |
251 | + LanguageKey { |
252 | + id: languageMenuButton; |
253 | + anchors.left: symShiftKey.right; |
254 | + height: parent.height; |
255 | + } |
256 | + |
257 | + CharKey { |
258 | + id: atKey; |
259 | + label: "@"; |
260 | + anchors.left: languageMenuButton.right; |
261 | + height: parent.height; |
262 | + } |
263 | + |
264 | + SpaceKey { |
265 | + id: spaceKey; |
266 | + anchors.left: atKey.right; |
267 | + anchors.right: zwnjKey.left; |
268 | + noMagnifier: true; |
269 | + height: parent.height; |
270 | + } |
271 | + |
272 | + CharKey { |
273 | + id: zwnjKey; |
274 | + label: ""; |
275 | + anchors.right: urlKey.left; |
276 | + height: parent.height; |
277 | + } |
278 | + |
279 | + UrlKey { |
280 | + id: urlKey; label: ".com"; |
281 | + extended: [".net", ".ir", ".ایران"]; |
282 | + anchors.right: dotKey.left; |
283 | + height: parent.height; |
284 | + } |
285 | + |
286 | + CharKey { |
287 | + id: dotKey; |
288 | + label: "."; |
289 | + extended: ["؟", "!"]; |
290 | + anchors.right: enterKey.left; |
291 | + height: parent.height; |
292 | + } |
293 | + |
294 | + ReturnKey { |
295 | + id: enterKey; |
296 | + anchors.right: parent.right; |
297 | + height: parent.height; |
298 | + } |
299 | + } |
300 | + } // column |
301 | +} |
302 | |
303 | === added file 'plugins/fa/qml/Keyboard_fa_url.qml' |
304 | --- plugins/fa/qml/Keyboard_fa_url.qml 1970-01-01 00:00:00 +0000 |
305 | +++ plugins/fa/qml/Keyboard_fa_url.qml 2014-09-28 10:04:07 +0000 |
306 | @@ -0,0 +1,127 @@ |
307 | +/* |
308 | + * Copyright 2013 Canonical Ltd. |
309 | + * |
310 | + * This program is free software; you can redistribute it and/or modify |
311 | + * it under the terms of the GNU Lesser General Public License as published by |
312 | + * the Free Software Foundation; version 3. |
313 | + * |
314 | + * This program is distributed in the hope that it will be useful, |
315 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
316 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
317 | + * GNU Lesser General Public License for more details. |
318 | + * |
319 | + * You should have received a copy of the GNU Lesser General Public License |
320 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
321 | + */ |
322 | + |
323 | +import QtQuick 2.0 |
324 | +import "../../keys" |
325 | +import "../../keys/key_constants.js" as UI |
326 | + |
327 | +KeyPad { |
328 | + anchors.fill: parent |
329 | + |
330 | + content: c1 |
331 | + symbols: "languages/Keyboard_symbols.qml" |
332 | + |
333 | + Column { |
334 | + id: c1 |
335 | + anchors.fill: parent |
336 | + spacing: 0 |
337 | + |
338 | + Row { |
339 | + anchors.horizontalCenter: parent.horizontalCenter; |
340 | + spacing: 0 |
341 | + |
342 | + CharKey { label: "ض"; extended: ["۱", "1"]; } |
343 | + CharKey { label: "ص"; extended: ["۲", "2"]; } |
344 | + CharKey { label: "ث"; extended: ["۳", "3"]; } |
345 | + CharKey { label: "ق"; extended: ["۴", "4"]; } |
346 | + CharKey { label: "ف"; extended: ["۵", "5"]; } |
347 | + CharKey { label: "غ"; extended: ["۶", "6"]; } |
348 | + CharKey { label: "ع"; extended: ["۷", "7"]; } |
349 | + CharKey { label: "ه"; extended: ["۸", "8"]; } |
350 | + CharKey { label: "خ"; extended: ["۹", "9"]; } |
351 | + CharKey { label: "ح"; extended: ["۰", "0"]; } |
352 | + CharKey { label: "ج";} |
353 | + } |
354 | + |
355 | + Row { |
356 | + anchors.horizontalCenter: parent.horizontalCenter; |
357 | + spacing: 0 |
358 | + CharKey { label: "ش"; } |
359 | + CharKey { label: "س"; } |
360 | + CharKey { label: "ی"; extended: ["ئ", "ي"]; } |
361 | + CharKey { label: "ب"; } |
362 | + CharKey { label: "ل"; } |
363 | + CharKey { label: "ا"; extended: ["آ", "أ". "إ"] } |
364 | + CharKey { label: "ت"; extended: ["ة"]; } |
365 | + CharKey { label: "ن"; } |
366 | + CharKey { label: "م"; } |
367 | + CharKey { label: "ک";; } |
368 | + CharKey { label: "گ"; } |
369 | + } |
370 | + |
371 | + Row { |
372 | + anchors.horizontalCenter: parent.horizontalCenter; |
373 | + spacing: 0 |
374 | + |
375 | + CharKey { label: "ظ"; } |
376 | + CharKey { label: "ط"; } |
377 | + CharKey { label: "ژ"; } |
378 | + CharKey { label: "ز"; } |
379 | + CharKey { label: "ر"; } |
380 | + CharKey { label: "ذ"; } |
381 | + CharKey { label: "د"; } |
382 | + CharKey { label: "پ"; } |
383 | + CharKey { label: "و"; } |
384 | + CharKey { label: "چ"; } |
385 | + BackspaceKey { padding: 0 } |
386 | + } |
387 | + |
388 | + Item { |
389 | + anchors.left: parent.left |
390 | + anchors.right: parent.right |
391 | + height: panel.keyHeight + units.gu(UI.row_margin); |
392 | + |
393 | + SymbolShiftKey { |
394 | + id: symShiftKey; |
395 | + anchors.left: parent.left; |
396 | + height: parent.height; |
397 | + } |
398 | + |
399 | + LanguageKey { |
400 | + id: languageMenuButton; |
401 | + anchors.left: symShiftKey.right; |
402 | + height: parent.height; |
403 | + } |
404 | + |
405 | + CharKey { |
406 | + id: slashKey; label: "/"; |
407 | + anchors.left: languageMenuButton.right; |
408 | + height: parent.height; |
409 | + } |
410 | + |
411 | + UrlKey { |
412 | + id: urlKey; label: ".com"; |
413 | + extended: [".net", ".ir", ".ایران"]; |
414 | + anchors.right: dotKey.left; |
415 | + height: parent.height; |
416 | + } |
417 | + |
418 | + CharKey { |
419 | + id: dotKey; label: "."; |
420 | + extended: ["؟", "!"]; |
421 | + anchors.right: enterKey.left; |
422 | + height: parent.height; |
423 | + } |
424 | + |
425 | + ReturnKey { |
426 | + id: enterKey; |
427 | + anchors.right: |
428 | + parent.right; |
429 | + height: parent.height; |
430 | + } |
431 | + } |
432 | + } // column |
433 | +} |
434 | |
435 | === added file 'plugins/fa/qml/Keyboard_fa_url_search.qml' |
436 | --- plugins/fa/qml/Keyboard_fa_url_search.qml 1970-01-01 00:00:00 +0000 |
437 | +++ plugins/fa/qml/Keyboard_fa_url_search.qml 2014-09-28 10:04:07 +0000 |
438 | @@ -0,0 +1,145 @@ |
439 | +/* |
440 | + * Copyright 2013 Canonical Ltd. |
441 | + * |
442 | + * This program is free software; you can redistribute it and/or modify |
443 | + * it under the terms of the GNU Lesser General Public License as published by |
444 | + * the Free Software Foundation; version 3. |
445 | + * |
446 | + * This program is distributed in the hope that it will be useful, |
447 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
448 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
449 | + * GNU Lesser General Public License for more details. |
450 | + * |
451 | + * You should have received a copy of the GNU Lesser General Public License |
452 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
453 | + */ |
454 | + |
455 | +import QtQuick 2.0 |
456 | +import "../../keys" |
457 | +import "../../keys/key_constants.js" as UI |
458 | + |
459 | +KeyPad { |
460 | + anchors.fill: parent |
461 | + |
462 | + content: c1 |
463 | + symbols: "languages/Keyboard_symbols.qml" |
464 | + |
465 | + Column { |
466 | + id: c1 |
467 | + anchors.fill: parent |
468 | + spacing: 0 |
469 | + |
470 | + Row { |
471 | + anchors.horizontalCenter: parent.horizontalCenter; |
472 | + spacing: 0 |
473 | + |
474 | + CharKey { label: "ض"; extended: ["۱", "1"]; } |
475 | + CharKey { label: "ص"; extended: ["۲", "2"]; } |
476 | + CharKey { label: "ث"; extended: ["۳", "3"]; } |
477 | + CharKey { label: "ق"; extended: ["۴", "4"]; } |
478 | + CharKey { label: "ف"; extended: ["۵", "5"]; } |
479 | + CharKey { label: "غ"; extended: ["۶", "6"]; } |
480 | + CharKey { label: "ع"; extended: ["۷", "7"]; } |
481 | + CharKey { label: "ه"; extended: ["۸", "8"]; } |
482 | + CharKey { label: "خ"; extended: ["۹", "9"]; } |
483 | + CharKey { label: "ح"; extended: ["۰", "0"]; } |
484 | + CharKey { label: "ج";} |
485 | + } |
486 | + |
487 | + Row { |
488 | + anchors.horizontalCenter: parent.horizontalCenter; |
489 | + spacing: 0 |
490 | + |
491 | + CharKey { label: "ش"; } |
492 | + CharKey { label: "س"; } |
493 | + CharKey { label: "ی"; extended: ["ئ", "ي"]; } |
494 | + CharKey { label: "ب"; } |
495 | + CharKey { label: "ل"; } |
496 | + CharKey { label: "ا"; extended: ["آ", "أ". "إ"] } |
497 | + CharKey { label: "ت"; extended: ["ة"]; } |
498 | + CharKey { label: "ن"; } |
499 | + CharKey { label: "م"; } |
500 | + CharKey { label: "ک";; } |
501 | + CharKey { label: "گ"; } |
502 | + } |
503 | + |
504 | + Row { |
505 | + anchors.horizontalCenter: parent.horizontalCenter; |
506 | + spacing: 0 |
507 | + |
508 | + CharKey { label: "ظ"; } |
509 | + CharKey { label: "ط"; } |
510 | + CharKey { label: "ژ"; } |
511 | + CharKey { label: "ز"; } |
512 | + CharKey { label: "ر"; } |
513 | + CharKey { label: "ذ"; } |
514 | + CharKey { label: "د"; } |
515 | + CharKey { label: "پ"; } |
516 | + CharKey { label: "و"; } |
517 | + CharKey { label: "چ"; } |
518 | + BackspaceKey { padding: 0 } |
519 | + } |
520 | + |
521 | + Item { |
522 | + anchors.left: parent.left |
523 | + anchors.right: parent.right |
524 | + height: panel.keyHeight + units.gu(UI.row_margin); |
525 | + |
526 | + SymbolShiftKey { |
527 | + id: symShiftKey; |
528 | + anchors.left: parent.left; |
529 | + height: parent.height; |
530 | + } |
531 | + |
532 | + LanguageKey { |
533 | + id: languageMenuButton; |
534 | + anchors.left: symShiftKey.right; |
535 | + height: parent.height; |
536 | + } |
537 | + |
538 | + CharKey { |
539 | + id: slashKey; |
540 | + label: "/"; |
541 | + anchors.left: languageMenuButton.right; |
542 | + height: parent.height; |
543 | + } |
544 | + |
545 | + SpaceKey { |
546 | + id: spaceKey; |
547 | + anchors.left: slashKey.right; |
548 | + anchors.right: zwnjKey.left; |
549 | + noMagnifier: true; |
550 | + height: parent.height; |
551 | + } |
552 | + |
553 | + CharKey { |
554 | + id: zwnjKey; |
555 | + label: ""; |
556 | + anchors.right: urlKey.left; |
557 | + height: parent.height; |
558 | + } |
559 | + |
560 | + UrlKey { |
561 | + id: urlKey; |
562 | + label: ".com"; |
563 | + extended: [".net", ".ir", ".ایران"]; |
564 | + anchors.right: dotKey.left; |
565 | + height: parent.height; |
566 | + } |
567 | + |
568 | + CharKey { |
569 | + id: dotKey; |
570 | + label: "."; |
571 | + extended: ["?", "!"]; |
572 | + anchors.right: enterKey.left; |
573 | + height: parent.height; |
574 | + } |
575 | + |
576 | + ReturnKey { |
577 | + id: enterKey; |
578 | + anchors.right: parent.right; |
579 | + height: parent.height; |
580 | + } |
581 | + } |
582 | + } // column |
583 | +} |
584 | |
585 | === added file 'plugins/fa/qml/qml.pro' |
586 | --- plugins/fa/qml/qml.pro 1970-01-01 00:00:00 +0000 |
587 | +++ plugins/fa/qml/qml.pro 2014-09-28 10:04:07 +0000 |
588 | @@ -0,0 +1,20 @@ |
589 | +TOP_BUILDDIR = $$OUT_PWD/../../.. |
590 | +TOP_SRCDIR = $$PWD/../../.. |
591 | + |
592 | +include($${TOP_SRCDIR}/config.pri) |
593 | + |
594 | +TARGET = dummy |
595 | +TEMPLATE = lib |
596 | + |
597 | +lang_ar.path = "$${UBUNTU_KEYBOARD_LIB_DIR}/ar/" |
598 | +lang_ar.files = *.qml *.js |
599 | + |
600 | +INSTALLS += lang_ar |
601 | + |
602 | +# for QtCreator |
603 | +OTHER_FILES += \ |
604 | + Keyboard_ar.qml \ |
605 | + Keyboard_ar_email.qml \ |
606 | + Keyboard_ar_url.qml \ |
607 | + Keyboard_ar_url_search.qml |
608 | + |
609 | |
610 | === added directory 'plugins/fa/src' |
611 | === added file 'plugins/fa/src/database_fa.db' |
612 | Binary files plugins/fa/src/database_fa.db 1970-01-01 00:00:00 +0000 and plugins/fa/src/database_fa.db 2014-09-28 10:04:07 +0000 differ |
613 | === added file 'plugins/fa/src/free_ebook.txt' |
614 | === added file 'plugins/fa/src/persianplugin.h' |
615 | --- plugins/fa/src/persianplugin.h 1970-01-01 00:00:00 +0000 |
616 | +++ plugins/fa/src/persianplugin.h 2014-09-28 10:04:07 +0000 |
617 | @@ -0,0 +1,25 @@ |
618 | +#ifndef PERSIANPLUGIN_H |
619 | +#define PERSIANPLUGIN_H |
620 | + |
621 | +#include <QObject> |
622 | +#include "languageplugininterface.h" |
623 | +#include "westernlanguagesplugin.h" |
624 | + |
625 | +class PersianPlugin : public WesternLanguagesPlugin |
626 | +{ |
627 | + Q_OBJECT |
628 | + Q_INTERFACES(LanguagePluginInterface) |
629 | + Q_PLUGIN_METADATA(IID "org.qt-project.Qt.Examples.PersianPlugin" FILE "persianplugin.json") |
630 | + |
631 | +public: |
632 | + explicit PersianPlugin(QObject* parent = 0) |
633 | + : WesternLanguagesPlugin(parent) |
634 | + { |
635 | + } |
636 | + |
637 | + virtual ~PersianPlugin() |
638 | + { |
639 | + } |
640 | +}; |
641 | + |
642 | +#endif // PERSIANPLUGIN_H |
643 | |
644 | === added file 'plugins/fa/src/persianplugin.json' |
645 | --- plugins/fa/src/persianplugin.json 1970-01-01 00:00:00 +0000 |
646 | +++ plugins/fa/src/persianplugin.json 2014-09-28 10:04:07 +0000 |
647 | @@ -0,0 +1,7 @@ |
648 | +{ |
649 | + "IID": "org.qt-project.Qt.Examples.PersianPlugin", |
650 | + "MetaData": { |
651 | + }, |
652 | + "className": "PersianPlugin", |
653 | + "debug": true |
654 | +} |
655 | |
656 | === added file 'plugins/fa/src/src.pro' |
657 | --- plugins/fa/src/src.pro 1970-01-01 00:00:00 +0000 |
658 | +++ plugins/fa/src/src.pro 2014-09-28 10:04:07 +0000 |
659 | @@ -0,0 +1,46 @@ |
660 | +TOP_BUILDDIR = $$OUT_PWD/../../.. |
661 | +TOP_SRCDIR = $$PWD/../../.. |
662 | + |
663 | +include($${TOP_SRCDIR}/config.pri) |
664 | + |
665 | +TEMPLATE = lib |
666 | +CONFIG += plugin |
667 | +QT += widgets |
668 | +INCLUDEPATH += \ |
669 | + $${TOP_SRCDIR}/src/ \ |
670 | + $${TOP_SRCDIR}/src/lib/ \ |
671 | + $${TOP_SRCDIR}/src/lib/logic/ |
672 | + $${TOP_SRCDIR}/plugins/westernsupport |
673 | + |
674 | +HEADERS = \ |
675 | + persianplugin.h |
676 | + |
677 | +TARGET = $$qtLibraryTarget(persianplugin) |
678 | + |
679 | +EXAMPLE_FILES = persianplugin.json |
680 | + |
681 | +# generate database for presage: |
682 | +PLUGIN_INSTALL_PATH = $${UBUNTU_KEYBOARD_LIB_DIR}/fa/ |
683 | + |
684 | +lang_db_fa.commands += \ |
685 | + rm -f $$PWD/database_fa.db && \ |
686 | + text2ngram -n 1 -l -f sqlite -o $$PWD/database_fa.db $$PWD/free_ebook.txt && \ |
687 | + text2ngram -n 2 -l -f sqlite -o $$PWD/database_fa.db $$PWD/free_ebook.txt && \ |
688 | + text2ngram -n 3 -l -f sqlite -o $$PWD/database_fa.db $$PWD/free_ebook.txt |
689 | +lang_db_fa.files += $$PWD/database_fa.db |
690 | +lang_db_fa.path = $$PLUGIN_INSTALL_PATH |
691 | +lang_db_fa.files += $$PWD/database_fa.db |
692 | + |
693 | +QMAKE_EXTRA_TARGETS += lang_db_fa lang_db_fa_install |
694 | + |
695 | +target.path = $$PLUGIN_INSTALL_PATH |
696 | +INSTALLS += target lang_db_fa_install |
697 | + |
698 | +OTHER_FILES += \ |
699 | + persianplugin.json \ |
700 | + free_ebook.txt |
701 | + |
702 | +LIBS += $${TOP_BUILDDIR}/plugins/plugins/libwesternsupport.a -lpresage -lhunspell |
703 | + |
704 | +INCLUDEPATH += $$PWD/../../westernsupport |
705 | +DEPENDPATH += $$PWD/../../westernsupport |
706 | |
707 | === added directory 'plugins/fa/tests' |
708 | === modified file 'plugins/plugins.pro' |
709 | --- plugins/plugins.pro 2014-07-28 18:19:04 +0000 |
710 | +++ plugins/plugins.pro 2014-09-28 10:04:07 +0000 |
711 | @@ -8,6 +8,7 @@ |
712 | de \ |
713 | en \ |
714 | es \ |
715 | + fa \ |
716 | fi \ |
717 | fr \ |
718 | he \ |
Hi Arash!
Thanks for helping to expand the number of layouts we support. There are a couple of extra things you'll need to do in this branch for packages to be created (detailed below), once those are done I'll ask the CI folks to enable jenkins builds on this MR, that way our system can automatically build packages for you and run our tests on the packages.
To let the rest of the keyboard system know about your plugin there are a couple of other files you'll need to make some small changes to. You'll need to add an entry for Persian in the languageIdToName function in qml/keys/ LanguageMenu. qml and in the freeTextLanguag eKeyboard and languageIsSupported functions in qml/KeyboardCon tainer. qml and WordEngine: :onLanguageChan ged in src/lib/ logic/wordengin e.cpp (these should really be redesigned to avoid the need for that, but that's currently fairly low on the priority list I'm afraid).
For the packaging you'll need to add an entry in the debian/control file to tell it about your new plugin, something like:
Package: ubuntu- keyboard- persian
myspell- fa,
${misc: Depends} ,
${shlibs: Depends} ,
Architecture: any
Depends: ubuntu-keyboard (= ${binary:Version}),
Description: Ubuntu on-screen keyboard data files - Persian
Data files for the Ubuntu virtual keyboard - Persian
This should be added after the entry for the ubuntu- keyboard- italian package (we list the language plugins alphabetically).
You'll also need to include an install file for the new Debian package (this tells the package build process which files to include), this can simply be a file in the debian/ directory called ubuntu- keyboard- persian. install with the line:
usr/share/ maliit/ plugins/ com/ubuntu/ lib/fa/
(Note that there isn't a slash at the beginning of the line).
If this causes any issues just let me know and I'll happily walk you through the process :)