mersenneforum.org  

Go Back   mersenneforum.org > Great Internet Mersenne Prime Search > Software

Reply
 
Thread Tools
Old 2021-08-06, 01:21   #12
Zhangrc
 
"University student"
May 2021
Beijing, China

269 Posts
Default

Quote:
Originally Posted by Prime95 View Post
Prime95/mprime "gave up" on localization as all text messages are hard-wired into the code. Fixed messages would not be terribly hard to place in a central location, but printf messages are much tougher. For example, "roundoff error of %g at iteration %d, rolling back to last save file %s". When localized, the %g, %d, and %s replacements might need to be in a different order.
I've tried to translate (a part of) the source code into Chinese yesterday. However, when I started compilation on VS2019, I saw the error "hwloc.h no such file or directory," repeated dozens of times. Is there a file shortage in Prime95 source code package?

also the "#pragma code_page" command is very difficult to adjust. I'm supposed to change it to 936 for a Chinese version, but even more errors and warnings occurred.
Zhangrc is offline   Reply With Quote
Old 2021-08-06, 01:59   #13
Prime95
P90 years forever!
 
Prime95's Avatar
 
Aug 2002
Yeehaw, FL

205716 Posts
Default

hwloc.h is here: https://www.open-mpi.org/software/hwloc/v2.4/
Prime95 is offline   Reply With Quote
Old 2021-08-06, 02:14   #14
retina
Undefined
 
retina's Avatar
 
"The unspeakable one"
Jun 2006
My evil lair

6,793 Posts
Default

Quote:
Originally Posted by Prime95 View Post
For example, "roundoff error of %g at iteration %d, rolling back to last save file %s". When localized, the %g, %d, and %s replacements might need to be in a different order.
Make it independent sentences.

English: "Roundoff error of %g. At iteration %d. Rolling back to last save file %s".
Nonglish: "Erreur %g du roundoff. Iteracion du %d. Saviour phile de %s du previour".
retina is online now   Reply With Quote
Old 2021-08-06, 02:33   #15
kriesel
 
kriesel's Avatar
 
"TF79LL86GIMPS96gpu17"
Mar 2017
US midwest

7,823 Posts
Default

Something that occurs to me is English synonyms might translate differently in different languages or different phrases.
at iteration becomes bei iteration,
by iteration (durch Iteration),
to iteration becomes zur iteration in German.
upon iteration (bei iteration)
after iteration (nach der Iteration)
Through iteration (durch Iteration)
on iteration (auf iteration)

But "upon" by itself became "auf".
(Again, google translate. My German is a dim memory.)

Last fiddled with by kriesel on 2021-08-06 at 02:39
kriesel is offline   Reply With Quote
Old 2021-08-06, 02:41   #16
Zhangrc
 
"University student"
May 2021
Beijing, China

1000011012 Posts
Default

Quote:
Originally Posted by retina View Post
English: "Roundoff error of %g. At iteration %d. Rolling back to last save file %s".
Chinese: "在第%d轮迭代出现%g的取整误差,回退到上一存储文件%s。" Notice that the order of %g and %d has been adjusted.
Zhangrc is offline   Reply With Quote
Old 2021-08-06, 08:47   #17
kruoli
 
kruoli's Avatar
 
"Oliver"
Sep 2017
Porta Westfalica, DE

23×71 Posts
Default

Quote:
Originally Posted by kriesel View Post
[…] I make no claims of correctness of the Google translate results, and don't understand the seemingly random capitalization it included. […]
It seems fine. In this case, all nouns are capitalized, which is correct.

Quote:
Originally Posted by kriesel View Post
Something that occurs to me is English synonyms might translate differently in different languages or different phrases. […]
Yes, and in general, prepositions might be translated differently according to the noun or verb used. For example "discriminate against" will turn to "diskriminieren", the "against" part (literally "gegen") has to be omitted.
kruoli is offline   Reply With Quote
Old 2021-08-06, 08:58   #18
axn
 
axn's Avatar
 
Jun 2003

125308 Posts
Default

It occurs to me that it would be much more productive to start with translating the readme/undoc/whatsnew files as, presumably, these would be the initial "go to" for users to get help.

BTW, localizing the messages on the program side can have the negative effect of making error reporting (screenshots, etc.) incomprehensible.

axn is offline   Reply With Quote
Old 2021-08-06, 14:05   #19
xilman
Bamboozled!
 
xilman's Avatar
 
"𒉺𒌌𒇷𒆷𒀭"
May 2003
Down not across

2×17×347 Posts
Default

Quote:
Originally Posted by axn View Post
It occurs to me that it would be much more productive to start with translating the readme/undoc/whatsnew files as, presumably, these would be the initial "go to" for users to get help.

BTW, localizing the messages on the program side can have the negative effect of making error reporting (screenshots, etc.) incomprehensible.

+1
xilman is offline   Reply With Quote
Old 2021-08-06, 14:24   #20
slandrum
 
Jan 2021
California

24·5·7 Posts
Default

Quote:
Originally Posted by axn View Post
BTW, localizing the messages on the program side can have the negative effect of making error reporting (screenshots, etc.) incomprehensible.
This can be handled by outputting the error messages twice if they are localized - once in the original English (or whatever original language is appropriate for the developer) for whoever is supporting/maintaining the code, and then in the localized language. This probably should be done with everything going to the log files, not just the errors, or have two log files being written.

Last fiddled with by slandrum on 2021-08-06 at 14:25
slandrum is offline   Reply With Quote
Old 2021-08-06, 15:06   #21
kriesel
 
kriesel's Avatar
 
"TF79LL86GIMPS96gpu17"
Mar 2017
US midwest

1E8F16 Posts
Default

maybe something like a localize-print function lprintf. Original calls to printf get changed to lprintf:

Code:
// skipping the C function definition, externs, whatever, here for brevity
//  sprintf to generate nativemessage string, then
if ( localizationlanguage != authorsnativelanguage ) {
   // a bit of sprintf to assemble the translated phrases and program-generated numbers into localizedmessage
   printf "%s \(%s\)\n", localizedmessage, nativemessage;
   // with due regard for message lengths, line wrap, etc.
} else {
   printf "%s\n", nativemessage; # no point in duplicating same language
}
I would probably put the same construct in a single log file with the relevant date/time stamps & TZ indicators.

If using localized log file and authors-language log file separately, how does the user identify what to collect for an issue report; matching time stamps after consideration of possible UTC offset differences between the log files, and perhaps verifying the result of collection matches up by using online translation, seems unnecessarily tedious, compared to grabbing a single section in a single file that is
Code:
user's selected TZ format time stamp
localized message
(author's language message)

Last fiddled with by kriesel on 2021-08-06 at 15:18
kriesel is offline   Reply With Quote
Old 2021-08-07, 11:36   #22
LaurV
Romulan Interpreter
 
LaurV's Avatar
 
"name field"
Jun 2011
Thailand

101000001100112 Posts
Default

Few products we made in the past (like pH Controllers, or programmers for rotary encoders, etc) can "speak" more languages (English, German, Spanish, Dutch, French, Italian, Portuguese, Russian, Romanian, Turkish) and we always keep the languages in separate files that we can edit in text mode, which evolved to be quite complex along the years, each line has an index of the message (same for all languages, to know what is translated, this is the connection between the files, the "unique key"), the position on screen (some messages are longer, or shorter, they may need to be moved few pixels in this or that directions, etc) and the alignment (left, centered, right, which accommodates well for tables, variable numbers, etc., as well as languages that are read from right to left, albeit we never used one of those), font and size (if the device accepts more fonts and sizes, mostly they do not, we just stay at 5x7 fonts for small LCDs incorporated in such products), then the message effectively, with format specifiers, conditions, and \n characters (some messages may need more lines, as they don't fit the small screen). The "conditions" part is tricky business, for example, that will allow to display "1 hour", but say "n hours" if the n is not 1. This was necessary because in some languages the sentence structure changes according with the numbers in the sentence, which you can not "fix in stone" in a dictionary-like file, without "ifs" and "loops" and a lot of programming logic. But the idea was to eliminate the logic from the dictionary files, which we succeeded very well, and the effect is that we can just supply the dictionary files separate and edit them in text mode when necessary, without changing the firmware. The texts effectively (except for Romanian) - we always asked the customer to supply them, and we just put them in the files. They (the customers) have, usually, branches in all these countries, and they have native speakers of those languages "at hand", so they would "take the responsibility" of how they want their product to look like. Also, some fields are editable, and the device only has 3 or 4 buttons (up, down, enter, escape, etc), and the format specifiers also know if the value you put there is fixed or editable, input or output, etc (they are treated differently, can you guess why?).

Last fiddled with by LaurV on 2021-08-07 at 11:43
LaurV is offline   Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Integrated graphics processors, how to run GIMPS software on them, and why you may not want to kriesel kriesel 8 2021-09-13 16:45
On the origin of language ... Dr Sardonicus Lounge 28 2018-10-10 19:52
Uninstall GIMPS Software? BillMMar Information & Answers 6 2010-05-02 22:23
Body Language Orgasmic Troll Lounge 2 2005-11-29 16:52
GIMPS software for Sony PS/2 Linux? delta_t Software 5 2002-12-06 17:36

All times are UTC. The time now is 13:54.


Fri Jul 7 13:54:13 UTC 2023 up 323 days, 11:22, 0 users, load averages: 1.28, 1.33, 1.21

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, Jelsoft Enterprises Ltd.

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.

≠ ± ∓ ÷ × · − √ ‰ ⊗ ⊕ ⊖ ⊘ ⊙ ≤ ≥ ≦ ≧ ≨ ≩ ≺ ≻ ≼ ≽ ⊏ ⊐ ⊑ ⊒ ² ³ °
∠ ∟ ° ≅ ~ ‖ ⟂ ⫛
≡ ≜ ≈ ∝ ∞ ≪ ≫ ⌊⌋ ⌈⌉ ∘ ∏ ∐ ∑ ∧ ∨ ∩ ∪ ⨀ ⊕ ⊗ 𝖕 𝖖 𝖗 ⊲ ⊳
∅ ∖ ∁ ↦ ↣ ∩ ∪ ⊆ ⊂ ⊄ ⊊ ⊇ ⊃ ⊅ ⊋ ⊖ ∈ ∉ ∋ ∌ ℕ ℤ ℚ ℝ ℂ ℵ ℶ ℷ ℸ 𝓟
¬ ∨ ∧ ⊕ → ← ⇒ ⇐ ⇔ ∀ ∃ ∄ ∴ ∵ ⊤ ⊥ ⊢ ⊨ ⫤ ⊣ … ⋯ ⋮ ⋰ ⋱
∫ ∬ ∭ ∮ ∯ ∰ ∇ ∆ δ ∂ ℱ ℒ ℓ
𝛢𝛼 𝛣𝛽 𝛤𝛾 𝛥𝛿 𝛦𝜀𝜖 𝛧𝜁 𝛨𝜂 𝛩𝜃𝜗 𝛪𝜄 𝛫𝜅 𝛬𝜆 𝛭𝜇 𝛮𝜈 𝛯𝜉 𝛰𝜊 𝛱𝜋 𝛲𝜌 𝛴𝜎𝜍 𝛵𝜏 𝛶𝜐 𝛷𝜙𝜑 𝛸𝜒 𝛹𝜓 𝛺𝜔