-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
22 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
|
||
# Translation Guide | ||
|
||
# OBServer | ||
|
||
OB has a translation function specified in OB.UI.translate and aliased as OB.t. Use OB.t to translate. OB.t accepts 1, 2, or 3 arguments. | ||
|
||
- 1 argument: if argument is a string, this string gets returned. If argument is an array, this gets converted to 1, 2, or 3 arguments. (so arguments can be accepted as array too). | ||
|
||
- 2 arguments: first argument is namespace, second argument is the string ID. see strings/*.txt for how this looks. | ||
|
||
- 3 arguments: first argument is namespace, second argument is string ID, third argument is data array which converts %1, %2, .. %n in string value to data[n]. | ||
|
||
HTML should have “data-t” attribute to indicate that tag contents should be translated. The tag contents specified in the HTML file will be the string ID. | ||
|
||
OB.UI.translateHTML = function( $element ) will do a translation on an element in the DOM. | ||
|
||
OB.UI.replaceMain will automatically translate. | ||
|
||
OB.UI.addMenuItem and OB.UI.addSubMenuItem will automatically translate. | ||
|
||
## OBPlayer |