how to deal with inligne variables and placeholders when transliting into rtl language - s

I have a game text to translate from english to arabic but I don't know which direction should the placeholder be.
Here is the sample text:
$(#Sprite,PureIcon,icon_map_01)$(#Sprite,PureIcon,icon_Magic_IceStorm)<color=blue>Corrupted Red Goblin</color> sighted.
صرخ العفريت<color=blue>$(#Sprite,PureIcon,icon_Magic_IceStorm)$(#Sprite,PureIcon,icon_map_01)
For each case below, which direction is correct in rtl language ?
$(#Sprite,PureIcon,icon_map_01) or (#Sprite,PureIcon,icon_map_01)$
%s or s%

Related

Text Input from QKeyEvent not working with Russian letters in QTextDocument

I have a strange problem with Text Input and Qt. I have a Widget that takes Key Press events, extracts the text and appends the text to a string variable and then creates a QTextDocument in the paint event and paints the text, so far so good, works with Latin letters. But when some users try to type non Latin letters like Russian, then some letters are are still in Latin and others are missing totally.
For example, typing this text: "Не работает на русском языке" results in this:
I'm getting the typed letters from QKeyEvent https://doc.qt.io/qt-5/qkeyevent.html#text
Any idea what causes this behavior and how to fix it?

Incorrect behaviour of Google Translation API with notranslate tags

Google Translate API allows indicating chunks of text that should not be translated with
<span translate='no'>Skip this text while translating</span>
In some cases there is an incorrect behaviour with non-translate tags, that causes the translation API to omit one of the words and to duplicate the non-translate tag. Input of the translation API:
0c40152c asdasd alsdls3 ec3f297a <span translate="no">AAAAA123AAAA</span> Nov 30 translate
When translating from Italian to English (not sure if the language matters), the following result is returned:
0c40152c asdasd alsdls3 ec3f297a <span translate="no">AAAAA123AAAA</span> Nov 30 <span translate="no">AAAAA123AAAA</span>
Please note that the 'translate' at the end of the text is substituted with the non-translate tag.
This issues are present if instead of <span translate='no'> I use the alternative syntax: <span class='notranslate'>.
Is this a known bug ? Does it have a sensible workaround ?
Is this a known bug?
Yes: https://issuetracker.google.com/issues/121076288
Translation problem with notranslate class in span tag
Problem you have encountered:
The translation API gives wrong results translating from german to arabic
German text:
QANTARA Migration - Kostenfreie Erstprüfung Ihrer Chancen für die erfolgreiche Immigration nach Deutschland
Arabic translation:
QANTARA Migration - إجراء فحص أولي مجاني لفرص نجاح QANTARA Migration إلى ألمانيا
What you expected to happen:
Correct translation without doubling the span with notranslate - this was doubled in arabic translation as you can see
There are also a few others that seem related, like https://issuetracker.google.com/issues/74168658 and https://issuetracker.google.com/issues/35902695.
Does it have a sensible workaround?
Only hacky ones, I'm afraid.
The easiest workaround is just to replace such sections with a token, like a unique number or url that Translate is smart enough not to touch, translate, then swap the original string back in.
A more general solution is to use something like ModelFront (full-disclosure: I work there) to detect errors, and do something only in those cases.
It seems like you have specified Italian as input language, but there are very few words in the text which can be translated (for example “translate”) and they are not recognised in the source language.
This can derivate in issues with the translation algorithm, which seems to be the case here.
A workaround would be setting the source language to get automatically detected by the API and checking the confidence value:
The confidence value is an optional floating point value between 0 and
1. The closer this value is to 1, the higher the confidence level for the language detection. This member is not always available
If the confidence value is high enough for your needs, it will try to detect the appropriate source language to translate from.
Another workaround could be adding more words to the text so the algorithm has more data to work with. I have tested the API with the same input as you describe but adding a few more words. The result output is the expected.

autocorrect the whole math equations within ms-word

I have written a plain text in notepad editor. This text contains some embedded mathematical formulas like \sumw_if(x_i) which refers to \sumw_if(x_i) or \alpha^2 + \beta^2 = \gamma^2 which refers to \alpha^2 + \beta^2 = \gamma^2etc.
Now, I'm looking for a way to autocorrect all those formulas within ms-word. First I tought to select formulas one by one and then "ALT +" to get the maths notation. This method works fine but it's frustrating because I have a bunch of equations
Is there any help? Macros, MathML or other tips?
Regards
If the embedded mathematical formulas were delimited with dollar signs -- e.g., $\alpha^2 + \beta^2 = \gamma^2$ -- MathType can do it with its Toggle TeX feature. If it's something you want to do programmatically, there's the MathType SDK.

Adding glyphs to Fontforge

When I open Fontforge to create a new font, it only lists a limited set of characters / glyphs. In the font I create, I need some glyphs that are missing from that default set, e.g. "single right-pointing angle quotation mark" (U+203A) and "single left-pointing angle quotation mark" (U+2039).
How can I add "slots" for these glyphs, or rather:
What is the proper way to add glyphs that are defined in the Unicode table?
Ah, well, just go to Encoding > Add encoding slot, then there will be a dialog to set how many slot(s) you want to add.
Ah, well, just go to Encoding > Reencode and choose an encoding that contains the relevant slots.

changing color scheme vim

I'm using VIM in red hat 5, with the black background and green letters. However, I don't like the color schema for strings ("") nor reserved C++ key variables (int for example it is in dark green). Could someone please give me some suggestions how could I change those default colors?
I know, for example, to change the comment collor I do
hl Comment ctermfg=yellow
Type :hi, then hit Enter. A list of highlighting definition will show.
The C++ groups start with c.
int is a cType. Try:
:hi cType ctermfg=yellow
You can put your custom highlighting commands into vimrc(after colorscheme name and syntax on).
If you'd want to customize your current colorscheme, check out this Vivify. Adjust the color editor to your specific language and then save the colorscheme file into your vimfiles.

Resources