Labs/Ubiquity/Parser 2/Localization Tutorial: Difference between revisions
No edit summary |
No edit summary |
||
Line 5: | Line 5: | ||
Ubiquity's Parser 2 was written from the ground up with one of its greatest priorities being internationalization... not just making commands localizable, but actually making it so Parser 2 can be easily taught the grammars of other languages. Key to this undertaking is an idea from the [http://en.wikipedia.org/wiki/Principles_and_parameters Principles and Parameters] school of linguistics, that all languages' grammars are made up of the following: (from wikipedia) | Ubiquity's Parser 2 was written from the ground up with one of its greatest priorities being internationalization... not just making commands localizable, but actually making it so Parser 2 can be easily taught the grammars of other languages. Key to this undertaking is an idea from the [http://en.wikipedia.org/wiki/Principles_and_parameters Principles and Parameters] school of linguistics, that all languages' grammars are made up of the following: (from wikipedia) | ||
* A finite set of fundamental '''principles''' that are common to all languages; e.g., that a sentence must always have a | * A finite set of fundamental '''principles''' that are common to all languages; e.g., that a sentence must always have a subject, even if it is not overtly pronounced. | ||
* A finite set of '''parameters''' that determine syntactic variability amongst languages; e.g., a binary parameter that determines whether or not the subject of a sentence must be overtly pronounced. | * A finite set of '''parameters''' that determine syntactic variability amongst languages; e.g., a binary parameter that determines whether or not the subject of a sentence must be overtly pronounced. | ||
Line 11: | Line 11: | ||
The result of this architecture is that it takes very little code to teach Parser 2 a new language. With a little bit of JavaScript and knowledge of and interest in your own language, you’ll be able to get at least rudimentary Ubiquity functionality in your language. Follow along in this step by step guide and please [http://ubiquity.mozilla.com/trac/ticket/662 submit your (even incomplete) language files]. | The result of this architecture is that it takes very little code to teach Parser 2 a new language. With a little bit of JavaScript and knowledge of and interest in your own language, you’ll be able to get at least rudimentary Ubiquity functionality in your language. Follow along in this step by step guide and please [http://ubiquity.mozilla.com/trac/ticket/662 submit your (even incomplete) language files]. | ||
== Set up your environment == | |||
If you’re new to Ubiquity core development, you’ll want to first read the [https://wiki.mozilla.org/Labs/Ubiquity/Ubiquity_0.1_Development_Tutorial Ubiquity Development Tutorial] to learn how to get a live copy of the Ubiquity repository using [http://en.wikipedia.org/wiki/Mercurial Mercurial]. | |||
As you read along, you may find it beneficial to follow along in some of the more complete language settings files included in Parser 2: [https://ubiquity.mozilla.com/hg/ubiquity-firefox/raw-file/tip/ubiquity/modules/parser/new/en.js English], [https://ubiquity.mozilla.com/hg/ubiquity-firefox/raw-file/tip/ubiquity/modules/parser/new/ja.js Japanese], [https://ubiquity.mozilla.com/hg/ubiquity-firefox/raw-file/tip/ubiquity/modules/parser/new/da.js Danish]. | |||
== The structure of the language file == |
Revision as of 07:22, 22 June 2009
If you are interested in command localization, please read the wiki pages on localizing commands and making commands localizable. This entry is for adding your language to Parser 2, so you can use Ubiquity with the grammar of your language.
Introduction
Ubiquity's Parser 2 was written from the ground up with one of its greatest priorities being internationalization... not just making commands localizable, but actually making it so Parser 2 can be easily taught the grammars of other languages. Key to this undertaking is an idea from the Principles and Parameters school of linguistics, that all languages' grammars are made up of the following: (from wikipedia)
- A finite set of fundamental principles that are common to all languages; e.g., that a sentence must always have a subject, even if it is not overtly pronounced.
- A finite set of parameters that determine syntactic variability amongst languages; e.g., a binary parameter that determines whether or not the subject of a sentence must be overtly pronounced.
Following this idea, we built a flexible universal parser, Parser 2, and pair it with a (often very small) set of individual language settings.
The result of this architecture is that it takes very little code to teach Parser 2 a new language. With a little bit of JavaScript and knowledge of and interest in your own language, you’ll be able to get at least rudimentary Ubiquity functionality in your language. Follow along in this step by step guide and please submit your (even incomplete) language files.
Set up your environment
If you’re new to Ubiquity core development, you’ll want to first read the Ubiquity Development Tutorial to learn how to get a live copy of the Ubiquity repository using Mercurial.
As you read along, you may find it beneficial to follow along in some of the more complete language settings files included in Parser 2: English, Japanese, Danish.