Defining a Language

Ra supports non-English programming. If the language you want to program in is supported by default, all you need is an "@@" directive:


If the language is not supported by default, you can easily define it using a .ralanguage file. For example, the français.ralanguage file looks like this:


Just place the .ralanguage file in the directory you are compiling your code from and use the "@@Language" directive, where "Language" is the name of the .ralanguage file without its extension. Classes and other types can be renamed in the .ralanguage file. If you want custom names for methods/cues/properties/fields, you can define a .ramembers file. The français.ramembers file looks like this:


The asterix (*) means the member is a cue that cannot be called with a dot then the cue name. For example, "foo.hash" is not valid. For completeness, you can define a .raerrors file to convert error messages. For example, the français.raerrors file looks like this:


Notice two colons are used in the .raerrors file. If you have defined a custom pattern class (this should inherit Pattern), you can create a .rapattern file. For example, the français.rapattern file looks like this:


The pattern options must be in the shown order. If you want to write todo/fix comments in another language, make a .ratodo file. The français.todo file looks like this:


"To do" in the other language must come first. If you want line numbers (for error/warning messages and todo/fix comments) to print in another language, define a .ranumbers file. For example, a .ranumbers file could look like this:


Ra supports the following: Arabic-Indic Eastern Arabic-Indic Devanagari Telugu Kannada Bengali Malayalam To print numbers in the language chosen in the .ranumbers file, use the "native numbers" keywords:


To prevent clutter, you can put the above files in a "RaLanguages" folder in the current directory. All characters used must be UTF8 characters.

To convert files to English:


Use the RaHighlighting class in the standard library to generate syntax highlighting files for your language definition. To see a list of all languages, use the terminal command "radefs". To see the contents of all the language definition files that make up a language, use "radefs <languageName>". To search language definition files, use "radefs <languageName> <searchTerm>".