Today I opened Sumatra PDF and it started in english although my platform is in german. I tried italian too but Sumatra remained in english. I even deleted the /Data folder and the problem was still there.
Can anyone reproduce this?
You are here
[Closed] Sumatra PDF: language switching broken?
October 2, 2012 - 4:19am
#1
[Closed] Sumatra PDF: language switching broken?
Using a fresh install of Sumatra I can semi-reproduce this with the following results:
So far language switching working as expected
Language switching not working when language is switched within the app
Edit: I believe it is because Sumatra is using custom code for lang switching, and is only checking/replacing the last language that Sumatra was switched to by the platform, not the last language switched to by the app.
The question is, is there a major reason why Sumatra requires a custom launcher and can't be done with PAL?
Sumatra uses a completely esoteric settings format. It isn't a config, INI, XML or similar. So, it can't be done in PAL. And we can't reference it within the file. We can only do a replace. So, if you ever switch it within Sumatra, it will stay switched unless you happen to sync it up to the platform again manually. There is no other fix.
Sometimes, the impossible can become possible, if you're awesome!
I had noticed that. The format does look semi-static, at least from my brief testing.
The entry for lang always begins with10:UILanguage2:
and is always followed by12:
, except for the prefs file in DefaultData, which has it followed bye12:
. But deleting the Data dir and running Sumatra results in the entry being followed by12:
anyway.Edit: No ignore that. Just noticed that 12: and e12: are the start of different entries.
Hello,
While it is true that SumatraPDF's settings are saved in a way that our current tools can not edit the stored language setting any way other than the current Replace, there is another option. I have written a patch to the launcher which will make it use an other option, but before I upload it I would like to know how to make it respond to unsupported languages.
I can either write it so that opening SumatraPDF from the Platform whilst the Platform is set to a language SumatraPDF does not support will open SumatraPDF in English, or I can set it to open SumatraPDF in the language SumatraPDF was set to when it was last closed.
Note: I have no preference, and neither option is easier or harder as I've actually written both already.
~3D1T0R
I'd suggest last closed. Rather than another custom launcher though, how about switching it to PAL as well? If you don't mind, that is.
Sometimes, the impossible can become possible, if you're awesome!
Yes, I see that this would actually be a pretty simple thing to put in PAL, but I've already put together a patch for the current Launcher (and fixed it ‘cause it wasn't quite right the first time around), if I did rewrite it in PAL I'd want to integrate GhostScriptPortable support too (which also shouldn't be too difficult), and I think I've typed enough tonight.
So, if nobody else wants to do it, I might decide to give this the PAL treatment, but in the mean-time the current Custom Launcher does work.
Edit: Looked into GhostScriptPortable support, and (as stated here) it should work if you add the GhostScriptPortable's Directory to the
PATH
Environment Variable.~3D1T0R
EDIT: Hey, I went through and tested the effects of this patch Language by Language (rather than simply trusting the lists like I had at first), and I've updated the Patch accordingly.
OK,
So if started from the Platform the Language will be set with the "-lang ¿?" argument (Documented Here & Here) to match, if it's a Language which the Platform & Sumatra use different codes to identify (I based my list of Discrepancies on This [SumatraPDF] & This [PA.cPlatform]) it will fix it; and if a Language which SumatraPDF doesn't support is selected, or it is not launched from the Platform (or if the Platform is set not to ‘use this Language for all PortableApps’) it will not pass the -lang argument (meaning that SumatraPDF will simply remember what Language it was set to at the time of it's last exit.)
BTW: What is the preferred method of posting patches?
Do you like “Place the following in
Source.File
, betweenLines X & Y
”?Or do you prefer .diff’s?
[.diff’s being like the following:]
P.S.: I chose
Localeglibc
because it had Portuguese (Portuguese [pt] & Brasilian [br/pt_BR] variants) & Chinese (Simple [cn/zh/zh_CN] & Traditional [tw/zh/zh_TW])separate, and already had Arabic [ar/ar-sa] & SpanishInternational [es/es-mx] as SumatraPDF requires them.~3D1T0R
I prefer to just get the whole file as Windows doesn't have much in the way of solid diff utilities I've found.
Sometimes, the impossible can become possible, if you're awesome!
Alright, I'll keep an eye out for a good DIFFing program on Windows.
(Too bad WinMerge doesn't understand .diff patches, it makes them, so it should)
Whole File: Link to Paste on 0bin.net.
Edit: WinMerge2011 says it can "apply patches" if they're in "unified patch" format, and have a .patch extension, by Drag&Dropping them onto the file that needs patched while it is open in one of it's editor panes (left or right shouldn't matter). However this is a fork of WinMerge which appears to still be in a relatively unstable state. Haven't tried it out yet, maybe later.
~3D1T0R
and with this Patch you no-longer need to have "
LastLanguage=en
" in theDefaultData\settings\SumatraPDFPortableSettings.ini
.(or do you not need that file at all any more?)
~3D1T0R