Note:

If you want to create a new page for developers, you should create it on the Moodle Developer Resource site.

String API: Difference between revisions

From MoodleDocs
No edit summary
No edit summary
Line 1: Line 1:
The String API is how you get language text strings to use in the user interface. It handles any language translations that might be available.
The String API is how you get language text strings to use in the user interface. It handles any language translations that might be available.


[[Places_to_search_for_lang_strings]] was the existing documentation on this.--[[User:Tim Hunt|Tim Hunt]] 16:04, 11 January 2012 (WST)
This doc should talk about (at least):


Also, I don't really like the name 'String API'. That sounds very low-level to me. PHP already has one. Internationalisation API, or Translation API, might be better.--[[User:Tim Hunt|Tim Hunt]] 16:04, 11 January 2012 (WST)
* basic information on how to format the main language file in a plugin (eg mod/forum/lang/en/xxxx.php), copy info from [[Places_to_search_for_lang_strings]] to here
* get_string(), get_strings(), print_string() functions and roughly how they work (language packs, parent languages etc)
* lang_string() class in 2.3

Revision as of 03:14, 16 January 2012

The String API is how you get language text strings to use in the user interface. It handles any language translations that might be available.

This doc should talk about (at least):

  • basic information on how to format the main language file in a plugin (eg mod/forum/lang/en/xxxx.php), copy info from Places_to_search_for_lang_strings to here
  • get_string(), get_strings(), print_string() functions and roughly how they work (language packs, parent languages etc)
  • lang_string() class in 2.3