EasyManua.ls Logo

Nokia Communicator 9210 - Do Not Declare Buffers of an Exact String; Avoid Clever Use of Strings; Do Not Reuse Strings; Watch out for Composite Messages

Nokia Communicator 9210
71 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
60 (71)
Copyright © Nokia Mobile Phones 2000. All rights reserved.
Translation often increases the length of a text by 30 %or more. In some cases, the character count can increase by
more than 100 %. For example, the command ‘‘Reply’’ is ‘‘Beantworten’’ in German and the verb ‘‘to mail’’ is ‘‘lähettää
sähköpostiviestinä’’ in Finnish.
Thus, allow at least 30 %for the horizontal expansion of texts. If your software is going to be localised into languages
that use ideograms or glyphs (Chinese, Japanese, Arabic), allow 10-20% for the vertical expansion of texts.
14.3.1 Do not declare buffers of an exact string
Do not declare buffers of the exact size of a word or sentence, as they will overflow when the text is localised.
14.4 Avoid clever use of strings
Avoid concatenating text strings. You might save space and it might work in English, but that does not mean that it
will work in other languages. English grammar and syntax are uniqueas are the grammar and syntax of every other
language.
If you can, test your English construction with other languages. This is usually enough to show the faults in the clever
code.
14.4.1 Do not reuse strings
Every single display text should have a string of its own in the resource files. For
example, in many languages adjectives and nouns are declined according to gender and number. A single string
displayed in different contexts will be correct in gender and number in some cases but incorrect in others.
14.4.2 Watch out for composite messages
The word order may have to be different for some languages, so use order-independent formatting functions to code
your composite messages. Also, the gender and number of the variable affect the gender and number of the other
words in the same context.
14.4.3 Watch out for dynamic text insertion
A program that inserts user-entered text into a predefined string may produce syntactical errors in any language,
including English. If you use dynamic text insertion, test your end result carefully.
14.4.4 Do not use clever plurals
The rules for constructing plural nouns vary from language to language, and can vary even within a single language.
For example, adding an ‘‘s’’ at runtime is not a universal solution for English. Another bad option is to use ‘‘(s)’’ as a
fixed suffix, as in ‘‘You have 1 new message(s),’’ and to assume that something similar can be constructed in every
language. Your best strategy is to spell out each possible pluralisation in your resources, rather than use a fixed suffix
or constructing plurals at runtime. Giving all the options for singular and plural may not be enough, since some
languages (Arabic, Slovene, Saami) have a dual case.
14.5 Do not assume the code set
A code set is an encoded set of characters in which each character is associated with a numeric value. Note that the
same character set can be encoded in different code sets. In other words, two code sets can define the same
characters using different codes for each character.
Do not limit character parsing to Latin script. In particular, watch out for case mapping and string comparison.
Operations that check whether a character is between A and Z might work for English, but they exclude important
characters in just about every other language in the world. Use generic system functions for cases like this.

Table of Contents

Related product manuals