Skip to content

MMD localization #37

Open
Open
@fletcher

Description

@fletcher

For the most part, the language used in MultiMarkdown documents don't matter. Whatever language you write in is the same text used in the output document.

An exception to this, however, is that there are a few phrases used in the HTML source, such as:

return to body
see footnote
see citation
see glossary

MMD-6 includes the i18n.h file to allow automatic translation of these phrases to other languages, without a performance hit.

The default language is English. Support is built in for German (missing 1 translation). Template strings are in place for Spanish.

Additional languages can be added easily.

  1. kNumberOfLanguages needs to be incremented.
  2. lc_lookup() needs to be modified -- a new language should be added to that function following the template for English/Spanish/German. The order is CRUCIALLY IMPORTANT.
  3. lc_languages() needs to be updated. The language added must be at the end of the list (in other words, the order must match that of lc_lookup(). The two letter code should be the official one for the new language.
  4. i18n_language_from_string() needs to be updated for the new language as well, using the lower case two letter code. Again, follow the template for German and Spanish.

Adding a new string is a bit more complicated, and should not generally need to be done. The TranslateTest() function is useful when doing so, however.

If you want to add/improve the translation functionality, please submit a pull request with the proposed changes. (Please use the develop branch for pull requests so I can properly merge and test.)

Thanks!!

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions