73 | | TranslateString() is called whenever a text element is constructed from an RML stream. ''input'' is the raw text read from the RML. ''translated'' should be set to the final text to be given to the text element to render. The total number of changes made to the raw text should be returned; this does not need to be precise, it is only used to quickly determine if any alterations were made, so a simple 0 for no alterations, 1 otherwise will suffice. This allows the application to send all text read from file through its string tables. Note that the translated text can include RML tags and they will be processed as if they were in the original stream; this can be used, for example, to substitute images for certain tokens. |
---|
| 73 | TranslateString() is called whenever a text element is constructed from an RML stream. This allows the application to send all text read from file through its string tables. |
---|
| 74 | |
---|
| 75 | ''input'' is the raw text read from the RML. ''translated'' should be set to the final text to be given to the text element to render. The total number of changes made to the raw text should be returned; If the number is greater than 0 libRocket will recursively call your translate function to process any new text that was added to the stream. If your translation function does all the recursion itself, you can safely return 0 on every call. |
---|
| 76 | |
---|
| 77 | Note that the translated text can include RML tags and they will be processed as if they were in the original stream; this can be used, for example, to substitute images for certain tokens. |
---|