Repository: nvaccess/nvda

Issue:
Excel: Labels for background text causes errors when converting .po to .mo
Hi,

reopened #6092:

When translators translate latest NVDA master strings 9ones with background pattern), Poedit and similar tools say validation has failed. Specifically, validation filaure is flagged for messages that involve pattern text, such as 25% gray and similar.

CC @ManshulBelani, @MichaelDCurran, @jcsteh 
Thanks.

Reported background pattern labels don't match with the patterns in Excel 2016
NVDA reports Excel background patterns thanks to #3683. I've been looking into this to translate the patterns, and I noticed that the pattern names aren't in line with the names given in Excel 2016. For example:
- 12,5% gray is reported as background pattern gray16
- Reverse Diagonal Stripe is reported as background pattern down
- Thick Diagonal Crosshatch is reported as semigray75

Especially the latter two make absolutely no sense to me. Since #3683 is closed and included in 2016.2, I thought it would be best to report this in a new issue here.



Discussion:
Technical: percent (%) character must be escaped. I'll write a PR to fix this. Thanks.

CC @ManshulBelani, 

> Poedit and similar tools say validation has failed.

When you say "similar tools", what other tools has this been reported with?

> Technical: percent (%) character must be escaped.

There's no way to escape it. The way you've done it in #6230 will cause a double percent sign for English. This string isn't meant to be interpreted as a % formatted string. The question is whether there's some way to prevent Poedit from doing this.

We can prevent Poedit and xgettext from marking these as python-format strings (and thus trying to validate the percent sign) by placing an "xgettext:no-python-format" comment before affected strings. See [this thread on the Poedit Google Group](https://groups.google.com/forum/#!topic/poedit/f34rrvx7UT8) and [this section of the GNU gettext documentation](https://www.gnu.org/software/gettext/manual/html_node/c_002dformat-Flag.html).

@ManshulBelani, could you look into this please? CC @DineshKaushal.

Reopening due to a major regression found:

@ManshulBelani, It seems background text is causing issues for translators, in that .po cannot be compiled into .mo.

Thanks.


Resolving patch:
diff --git a/source/NVDAObjects/window/excel.py b/source/NVDAObjects/window/excel.py
--- a/source/NVDAObjects/window/excel.py
+++ b/source/NVDAObjects/window/excel.py
@@ -112,18 +112,23 @@
 		xlPatternDown:_("reverse diagonal stripe"),
 		# Translators: A type of background pattern in Microsoft Excel. 
 		# 12.5% gray
+		# xgettext:no-python-format
 		xlPatternGray16:_("12.5% gray"),
 		# Translators: A type of background pattern in Microsoft Excel. 
 		# 25% gray
+		# xgettext:no-python-format
 		xlPatternGray25:_("25% gray"),
 		# Translators: A type of background pattern in Microsoft Excel. 
+		# xgettext:no-python-format
 		# 50% gray
 		xlPatternGray50:_("50% gray"),
 		# Translators: A type of background pattern in Microsoft Excel. 
 		# 75% gray
+		# xgettext:no-python-format
 		xlPatternGray75:_("75% gray"),
 		# Translators: A type of background pattern in Microsoft Excel. 
 		# 6.25% gray
+		# xgettext:no-python-format
 		xlPatternGray8:_("6.25% gray"),
 		# Translators: A type of background pattern in Microsoft Excel. 
 		# Grid


Test patch: