1,502
edits
(Add an example to explain the difference between _() and _s()) |
m (Layout) |
||
Line 10: | Line 10: | ||
An example to illustrate the difference between _() and _s(): | An example to illustrate the difference between _() and _s(): | ||
_() is a function, and is used within code. So it's used in cases like this: | |||
* _() is a function, and is used within code. So it's used in cases like this: | |||
_s() is a wrapper, used with static string constants. So it's used in cases like this: | <syntax type="C++"> | ||
foo(_("Bar")); | |||
</syntax> | |||
* _s() is a wrapper, used with static string constants. So it's used in cases like this: | |||
<syntax type="C++"> | |||
char *foo { | char *foo { | ||
_s("bar"), | _s("bar"), | ||
_s("baz") | _s("baz") | ||
}; | }; | ||
</syntax> | |||
If you want to give some additional explanations to the translators, or your string could be understood in a different ways, it is recommended to precede it with a comment tagged I18N. | If you want to give some additional explanations to the translators, or your string could be understood in a different ways, it is recommended to precede it with a comment tagged I18N. |
edits