Concatenate the .po files into a single .po file - localization

i have to concatenate following two .PO files
firstfile.po
msgid "Select game"
msgstr "Choisissez le jeu"
msgid "Without answers1"
msgstr "Guide d'achat1"
secondfile.po
msgid "Select game"
msgstr "Choose category"
msgid "any one answer"
msgstr "Guide d'achat
Here while i concating using msgcat without using --use-first the output po obtained is given below.
output.po
msgid "Select game"
msgstr "Choisissez le jeu"
msgid "Without answers1"
msgstr "Guide d'achat1
msgid "any one answer"
msgstr "Guide d'achat
Thev above output file doesnot contain all the msgstrs found for the repeated msgid.
expected output is
output.po
msgid "Select game"
msgstr "Choisissez le jeu"
msgid "Without answers1"
msgstr "Guide d'achat1"
msgid "Select game"
msgstr "Choose category"
msgid "any one answer"
msgstr "Guide d'achat
Is there any way to repeat the same msgid in the output PO file

Maybe you can use such comand copy firstfile.po+secondfile.po output.po

Related

How to add name in bib file in latex

I have a name like Catherine de Palo Drid . I want its reference like
Drid C de P
I add like that
author={Drid, Catherine, de, Palo}
I have changed many times the arrangement, but neither works.
Can anyone help?
THANKS
From the BibTeX documentation (btxdoc.pdf, p. 15/16):
Each name consists of four parts: First, von, Last, and Jr;
BibTeX allows three possible forms for the name:
"First von Last"
"von Last, First"
"von Last, Jr, First"
You want to treat "Catherine de Palo" as First and "Drid" as Last, since abbreviating names is only done in First. In that case I would use
author = {Drid, Catherine {de} Palo}
where the braces around "de" tell BibTeX to not alter that token.

Is there any way to skip particular words from translation in 'GoogleTranslate()' function in spreadsheets?

I am using GoogleTranslate() with Sheets to translate some contents into different languages. In those contents, we have some placeholders that do not need to translate. E.g.:
This is a Sample Text added by `{__NAME__}` on `{__DATE__}`
I do not need to translate placeholders like {__NAME__} and {__DATE__}.
How can I skip those words from the translation process?
=ARRAYFORMULA(QUERY(IFERROR(VLOOKUP(TRANSPOSE(SPLIT(GOOGLETRANSLATE(QUERY(
REGEXREPLACE(TRANSPOSE(SPLIT(A1, " ")), "\{.*\}", "♦"),, 999^99), "en", "es"), " ")),
{REGEXREPLACE(TRANSPOSE(SPLIT(A1, " ")), "\{.*\}", "♦"), TRANSPOSE(SPLIT(A1, " "))}, 2, 0),
TRANSPOSE(SPLIT(GOOGLETRANSLATE(QUERY(REGEXREPLACE(
TRANSPOSE(SPLIT(A1, " ")), "\{.*\}", "♦"),,999), "en", "es"), " "))),,999^99))
Finally find a way, as it seems logical that gtranslate don't translate email adress you can easily protect words with email pattern:
exemple, translating the following sentence from en to ru:
"I need %amount% of cherry"
Original translate from en to ru using: =GOOGLETRANSLATE(A3,"en", "ru")
"Мне нужно% Сумма% вишни"
Step1: replacing %amount% by skip#skip.amount.skip.com :
=GOOGLETRANSLATE(REGEXREPLACE(A3, "%(.*?)%", "skip#skip.$1.skip.com"),"en", "ru")
Мне нужно skip#skip.amount.skip.com вишни
Step2 : replacing back skip#skip.amount.skip.com with %amount%,
=REGEXREPLACE(GOOGLETRANSLATE(REGEXREPLACE(A5, "%(.*?)%", "skip#skip.$1.skip.com"),"en", "tr"), "(?i)skip#\s*skip.(.*?).skip.com", "%$1%")
Мне нужно %amount% вишни

Slightly better way of removing new lines

I've got a text/string that contains multiple newlines. Like in the example below :
"This is a test message : \n \n\n \n \n \n \n \n \n \n \n \n  \n \n \n \n \n \n \n
 "
I can gsub all \n with space and remove them all. How can I do the following :
If I see that there is more than two \n, leave only two newlines in the text?
If you want to remove all but the first two newlines you can use the block passed to gsub:
hits = 0
text.gsub(/\n/) { (hits = hits + 1) > 2 ? '' : "\n" }
# => "This is a test message : \n \n "
You can replace any sequences of three or more newlines with nothing in between, by using the following regex (assuming s
contains your string):
s.gsub /\n\n+/, "\n\n"
If you want to allow any amount of interleaving space characters between the newlines and remove that as well, better use:
s.gsub /\n *(\n *)+/, "\n\n"

Unable to make grep search for uppercase letters work reliably

I have several large text files that I want to grep the thousands of records in them that have a string on 1 line of each record that says "1 name userabc.db" or "1 name xy040101.db" or "1 name abcdfr.db" or "1 name efgh.db" for example.
The string "userabc.db", etc, could have uppercase letters in this name, like USERABC.DB, or Userabc.db or userAbc.db, anywhere in the name of the .db file..
So I need to be able to search for and identify this line in each record that has an uppercase letter anywhere on this line, if any.
When I use "grep '[1 name ][A-Z] ./store.txt" no double quotes, I find :
"1 name USERxxx.db" and
"1 name Xy040101.DB" and
"1 name Abcdfr.db" and
"1 name EFGH.DB" but not when the uppercase letter or letters begins at the 2nd or subsequent letter position of the .db file name in the line in question.
Bottom line is I need to be able to find all lines that have an uppercase letter or letters when these letters are anywhere in the name of the .db file not just at the beginning or when all letters are uppercase..
Can this be done ? maybe better done with sed or awk ?
Thanks,
Bob Perez (bperez#novell.com)
All you need is:
grep "1 name .*[A-Z].*" ./store.txt
.* will match any character any number of times.

How can I replace new lines with \n character

Data stored in the database is like this:
This is a line
This is another line
How about this line
When I output it to the view, I want to convert that to:
This is a line\n\nThis is another line\n\nHow about this line
with no new lines and the actual \n characters printed out. How can I do that?
> s = "hi\nthere"
> puts s
hi
there
> puts s.gsub(/\n/, "\\n")
hi\nthere
I would personally use gsub if you only want newlines specifically converted. However, if you want to generally inspect the contents of the string, do this:
str = "This is a line\n\nThis is another line\n\nHow about this line"
puts str.inspect[1..-2]
#=> This is a line\n\nThis is another line\n\nHow about this line
The String#inspect method escapes various 'control' characters in your string. It also wraps the string with ", which I've stripped off above. Note that this may produce undesirable results, e.g. the string My name is "Phrogz" will come out as My name is \"Phrogz\".
> s = "line 1\n\nline2"
=> "line 1\n\nline2"
> puts s
line 1
line2
> puts s.gsub("\n", "\\n")
line 1\n\nline2
The key is to escape the single backslash.

Resources