root/functions/translate.r

Revision 111, 0.7 kB (checked in by ashley, 9 months ago)

Split requestors off into %rebgui-requestors.r
Requestors and functions now appear in their respective parent objects
Added new on-resize handler
tab-panel.r and chat.r fixes
RebDOC.r enhancements

Line 
1translate: make function! [
2        "Dynamically translate a string or block of strings."
3        text "String (or block of strings) to translate"
4        /local match
5] [
6        ;       Note that if text is not a string! or block! then no error will be raised.
7        ;       This is an optimization so code that calls translate does not have to be
8        ;       wrapped in an "if string? text ..." type construct.
9        if all [series? text locale*/words] [
10                text: copy/deep text
11                all [
12                        string? text
13                        match: select/skip locale*/words text 2
14                        insert clear text match
15                ]
16                if block? text [
17                        foreach word text [
18                                all [
19                                        string? word
20                                        match: select/skip locale*/words word 2
21                                        insert clear word match
22                                ]
23                        ]
24                ]
25        ]
26        text
27]
Note: See TracBrowser for help on using the browser.