Mailinglist Archive: yast-commit (819 mails)

< Previous Next >
[yast-commit] r54390 - in /trunk/yast2: library/types/src/String.ycp library/types/testsuite/tests/String.out library/types/testsuite/tests/String.ycp package/yast2.changes
  • From: jsrain@xxxxxxxxxxxxxxxx
  • Date: Tue, 06 Jan 2009 11:17:57 -0000
  • Message-id: <E1LK9wb-0002FV-W1@xxxxxxxxxxxxxxxx>
Author: jsrain
Date: Tue Jan 6 12:17:57 2009
New Revision: 54390

URL: http://svn.opensuse.org/viewcvs/yast?rev=54390&view=rev
Log:
added String::RemoveShortcut to allow using widget labels in help texts to
ensure translations are in sync (bnc #307220)


Modified:
trunk/yast2/library/types/src/String.ycp
trunk/yast2/library/types/testsuite/tests/String.out
trunk/yast2/library/types/testsuite/tests/String.ycp
trunk/yast2/package/yast2.changes

Modified: trunk/yast2/library/types/src/String.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/yast2/library/types/src/String.ycp?rev=54390&r1=54389&r2=54390&view=diff
==============================================================================
--- trunk/yast2/library/types/src/String.ycp (original)
+++ trunk/yast2/library/types/src/String.ycp Tue Jan 6 12:17:57 2009
@@ -1242,5 +1242,18 @@
return ret;
}

+/**
+ * Remove a shortcut from a label, so that it can be inserted into help
+ * to avoid risk of different translation of the label
+ * @param label string a label possibly including a shortcut
+ * @return string the label without the shortcut mark
+ */
+global string RemoveShortcut (string label) {
+ string ret = label;
+ if (regexpmatch (label, "^(.*[^&])?(&&)*&[[:alnum:]].*$"))
+ ret = regexpsub (label, "^((.*[^&])?(&&)*)&([[:alnum:]].*)$", "\\1\\4");
+ return ret;
+}
+
/* EOF */
}

Modified: trunk/yast2/library/types/testsuite/tests/String.out
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/yast2/library/types/testsuite/tests/String.out?rev=54390&r1=54389&r2=54390&view=diff
==============================================================================
--- trunk/yast2/library/types/testsuite/tests/String.out (original)
+++ trunk/yast2/library/types/testsuite/tests/String.out Tue Jan 6 12:17:57
2009
@@ -110,3 +110,16 @@
Dump Strings::EscapeTags
Return &lt;font size='2'&gt;&lt;b&gt;text &amp; another&lt;/b&gt;&lt;/font&gt;
Return 2 &gt; 1
+Dump Strings::RemoveShortcut
+Return Hello
+Return Hello
+Return He&&llo
+Return He&&llo
+Return He&&&&llo
+Return He&&&&llo
+Return Hello
+Return &&Hello
+Return &&Hello
+Return &&&&Hello
+Return &&&&Hello
+Return &&Hello

Modified: trunk/yast2/library/types/testsuite/tests/String.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/yast2/library/types/testsuite/tests/String.ycp?rev=54390&r1=54389&r2=54390&view=diff
==============================================================================
--- trunk/yast2/library/types/testsuite/tests/String.ycp (original)
+++ trunk/yast2/library/types/testsuite/tests/String.ycp Tue Jan 6 12:17:57
2009
@@ -148,4 +148,18 @@
DUMP("Strings::EscapeTags");
TEST(``(String::EscapeTags("<font size='2'><b>text & another</b></font>")),
[], nil);
TEST(``(String::EscapeTags("2 > 1")), [], nil);
+
+DUMP("Strings::RemoveShortcut");
+TEST(``(String::RemoveShortcut("Hello")), [], nil);
+TEST(``(String::RemoveShortcut("He&llo")), [], nil);
+TEST(``(String::RemoveShortcut("He&&llo")), [], nil);
+TEST(``(String::RemoveShortcut("He&&&llo")), [], nil);
+TEST(``(String::RemoveShortcut("He&&&&llo")), [], nil);
+TEST(``(String::RemoveShortcut("He&&&&&llo")), [], nil);
+TEST(``(String::RemoveShortcut("&Hello")), [], nil);
+TEST(``(String::RemoveShortcut("&&Hello")), [], nil);
+TEST(``(String::RemoveShortcut("&&&Hello")), [], nil);
+TEST(``(String::RemoveShortcut("&&&&Hello")), [], nil);
+TEST(``(String::RemoveShortcut("&&&&&Hello")), [], nil);
+TEST(``(String::RemoveShortcut("&&He&llo")), [], nil);
}

Modified: trunk/yast2/package/yast2.changes
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/yast2/package/yast2.changes?rev=54390&r1=54389&r2=54390&view=diff
==============================================================================
--- trunk/yast2/package/yast2.changes (original)
+++ trunk/yast2/package/yast2.changes Tue Jan 6 12:17:57 2009
@@ -1,4 +1,10 @@
-------------------------------------------------------------------
+Tue Jan 6 12:12:09 CET 2009 - jsrain@xxxxxxx
+
+- added String::RemoveShortcut to allow using widget labels in help
+ texts to ensure translations are in sync (bnc #307220)
+
+-------------------------------------------------------------------
Tue Dec 30 14:37:45 CET 2008 - lslezak@xxxxxxx

- use "Installed Size" label in the summary table during package

--
To unsubscribe, e-mail: yast-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages