[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-i18n-doc
Subject:    Re: Add explict line break into system settings icon name of Chinese translation
From:       Albert Astals Cid <aacid () kde ! org>
Date:       2017-01-24 23:00:08
Message-ID: 5886607.pZrAnMNLvd () xps
[Download RAW message or body]

El dilluns, 9 de gener de 2017, a les 15:32:31 CET, chaofeng111@gmail.com va 
escriure:
> 在 2017年1月6日星期五 CST 下午1:02:18,Albert Astals Cid 写道:
> 
> > El dijous, 5 de gener de 2017, a les 17:49:53 CET, chaofeng111@gmail.com
> > va
> > 
> > escriure:
> > > Hi,
> > > 
> > > This is another attempt to fix Bug 234407[1] - systemsettings iconview
> > > wordwrapping cause narrow icon in zhcn locale. The latest fix attempt
> > > posted 3 years ago[2] is rejected by Thomas Lübking because to show
> > > correctly, a random value is picked up which is not ideal.
> > > 
> > > Since the only problem exist in System settings, here I want to propose
> > > another fix by insert \n into the "Name" field explictly. Example as
> > > below:
> > > 
> > > #: kcms/desktoptheme/kcm_desktoptheme.desktop:13
> > > #: kcms/desktoptheme/package/metadata.desktop:2
> > > msgctxt "Name"
> > > msgid "Desktop Theme"
> > > msgstr "桌面\n主题"
> > > 
> > > I verify it locally and it indeed fix the problem without any other
> > > potential side effect as previous solution. And we zh-cn translation
> > > team
> > > will take care of the actual line break of localized system settings.
> > > 
> > > But after the new po is submitted, the "\n" is automatically removed by
> > > scripty. So the question is:
> > > * Is the auto correction activated because the msgid does not have "\n"
> > > in
> > > it? * If it is so, is there any mechanism to skip this auto correction?
> > 
> > Can you point out in which SVN revision the "\n" was removed by scripty?
> > It'll make investigation easier.

Sorry for the late reply, but can you confirm what are you trying to fix by 
adding a \n in that .desktop file? I thought you wanted to fix something 
regarding the icon view in system settings, but that desktop file is not used 
for creating the system settings icons view at all.

What i get http://i.imgur.com/S2kWGTS.png doesn't seem that bad, or is it? 
(not knowing Chinese it may be awful and i would not see it)

Cheers,
  Albert

> 
> I double check the desktop entry spec[3], it should be spported:
> 
> "The escape sequences \s, \n, \t, \r, and \\ are supported for values of
> type string and localestring, meaning ASCII space, newline, tab, carriage
> return, and backslash, respectively."
> 
> Find below files that may need change. It seems both desktop file extractor
> and merger treat \n as invalid.
> 
> 1. l10n-kf5/scripts/check_desktop_files
> 
> sub check_msgstr check if translation contains newline, if yes, it mark the
> translation as fuzzy.
> 
> # Check a msgid/msgstr pair for consistency
> # Returns 0 on error (i.e. fuzzify this msgstr) and 1 on success
> sub check_msgstr($$$){
>         my ($msgid, $msgstr,$current_file) = @_;
>         if ($msgstr =~ m/[^\\]\\n/) {
>                 print STDERR "translation contains newline in $current_file:
> $line_number\n";
>                 return 0;
>         }
>         return 1;
> }
> 
> 2. In l10n-kf5/scripts/applycontext.cpp, there is a new line check, if
> newline is found in translation, the out put in .desktop file is skipped.
> 
> if (strchr(test, '\n')) {
>     // We must avoid printing any control character
>     fprintf(stderr, "ERROR: %s's translation of \"%s\" contains a
> newline\n", argv[i], in);
>     continue;
> }
> 
> Could those tests just be removed? I want to try but do not know how to run
> applycontext on
> kf5/messages/kde-workspace/desktop_workspace_systemsettings.po
> 
> [3]
> https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spe
> c-latest.html
> > Cheers,
> > 
> >   Albert
> >   
> > > Thanks.
> > > 
> > > [1] https://bugs.kde.org/show_bug.cgi?id=234407
> > > [2] https://git.reviewboard.kde.org/r/108328/
> > > 
> > > Feng Chao


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic