Skip to content

Corrected chinese braille table names#13675

Merged
seanbudd merged 2 commits into
nvaccess:masterfrom
cary-rowen:CorrectedChineseBrailleTableNames
May 19, 2022
Merged

Corrected chinese braille table names#13675
seanbudd merged 2 commits into
nvaccess:masterfrom
cary-rowen:CorrectedChineseBrailleTableNames

Conversation

@cary-rowen

Copy link
Copy Markdown
Contributor

Link to issue number:

Close #13674

Summary of the issue:

The following entries exist in the Output Table and Input Table combo boxe in the NVDA Braille Settings panel:

  • Chinese (China, Mandarin) grade 1
  • Chinese (China, Mandarin) grade 2

According to the definition in the Chinese National Standard GB/T 15720-2008, sections 2.13 and 2.14:

  • "Chinese (China, Mandarin) grade 1" should be changed to "Chinese (China) Current Braille System"
  • "Chinese (China, Mandarin) grade 2" should be changed to "Chinese (China) Double-phonic Braille System"

Due to copyright reasons, the text in the above "GB/T 15720-2008" link cannot be read by visually impaired users, but it can be previewed in image form.

Description of how this pull request fixes the issue:

I modified the corresponding string in source/brailleTables.py.

Testing strategy:

manual testing

Known issues with pull request:

None

Change log entries:

New features

Changes

Corrected chinese braille table names:

  • "Chinese (China, Mandarin) grade 1" changed to "Chinese (China) Current Braille System"
  • "Chinese (China, Mandarin) grade 2" changed to "Chinese (China) Double-phonic Braille System"

Bug fixes

For Developers

Code Review Checklist:

  • Pull Request description:
    • description is up to date
    • change log entries
  • Testing:
    • Unit tests
    • System (end to end) tests
    • Manual testing
  • API is compatible with existing add-ons.
  • Documentation:
    • User Documentation
    • Developer / Technical Documentation
    • Context sensitive help for GUI changes
  • UX of all users considered:
    • Speech
    • Braille
    • Low Vision
    • Different web browsers
    • Localization in other languages / culture than English

@cary-rowen cary-rowen requested a review from a team as a code owner May 9, 2022 04:39
@cary-rowen cary-rowen requested a review from seanbudd May 9, 2022 04:39
@cary-rowen cary-rowen closed this May 9, 2022
@cary-rowen cary-rowen reopened this May 9, 2022
@cary-rowen

Copy link
Copy Markdown
Contributor Author

Hi @seanbudd, this is a small fix, can it be merged?

@cary-rowen cary-rowen force-pushed the CorrectedChineseBrailleTableNames branch from 3da7310 to 5c712ca Compare May 10, 2022 08:58

@seanbudd seanbudd left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you are expecting the translators to translate this to a specific string, it's worth adding a message in the translator comments. Use my comments below as an example.

Comment thread source/brailleTables.py
Comment thread source/brailleTables.py
@cary-rowen

Copy link
Copy Markdown
Contributor Author

HI @seanbudd
I can't seem to successfully add a translator's note with Chinese characters, otherwise Gettext will throw an error.
So, even though I applied your suggested changes, translators using Poedit cannot see the comments.

@CyrilleB79

Copy link
Copy Markdown
Contributor

You may give a try be defining the coding as first line of your file:

# -*- coding: utf-8 -*-

It is written in NVDA's codingStandards.md, in the 'Encoding' paragraph.

Even if it is not required for Python 3, it seems it is required in some situations for gettext. See here.

@AppVeyorBot

Copy link
Copy Markdown

See test results for failed build of commit 50e311247a

@cary-rowen

Copy link
Copy Markdown
Contributor Author

Thanks @CyrilleB79

I define the coding on the first line, but when I run scons pot it still throws an error:

cd source && D:\git\nvda\miscDeps\tools\xgettext.exe -o D:\git\nvda\output\nvda_snapshot_source-CorrectedChineseBrailleT
ableNames-4aa8735.pot --package-name NVDA --package-version source-CorrectedChineseBrailleTableNames-4aa8735 --foreign-u
ser --add-comments=Translators: --keyword=pgettext:1c,2 --from-code utf-8 --language=python --files-from=D:\git\nvda\out
put\potSourceFileList.txt
scons: *** [output\nvda_snapshot_source-CorrectedChineseBrailleTableNames-4aa8735.pot] UnicodeDecodeError : 'gbk' codec
can't decode byte 0xad in position 2154: illegal multibyte sequence
Traceback (most recent call last):
  File "D:\git\nvda\.venv\lib\site-packages\SCons\Action.py", line 1279, in execute
    result = self.execfunction(target=target, source=rsources, env=env)
  File "D:\git\nvda\SConstruct", line 474, in makePot
    for lineNum, line in enumerate(inp):
UnicodeDecodeError: 'gbk' codec can't decode byte 0xad in position 2154: illegal multibyte sequence
scons: building terminated because of errors.
Deactivating NVDA Python virtual environment

@AppVeyorBot

Copy link
Copy Markdown

See test results for failed build of commit b5b30f0ba8

@CyrilleB79

Copy link
Copy Markdown
Contributor

Thanks @CyrilleB79

I define the coding on the first line, but when I run scons pot it still throws an error:

cd source && D:\git\nvda\miscDeps\tools\xgettext.exe -o D:\git\nvda\output\nvda_snapshot_source-CorrectedChineseBrailleT
ableNames-4aa8735.pot --package-name NVDA --package-version source-CorrectedChineseBrailleTableNames-4aa8735 --foreign-u
ser --add-comments=Translators: --keyword=pgettext:1c,2 --from-code utf-8 --language=python --files-from=D:\git\nvda\out
put\potSourceFileList.txt
scons: *** [output\nvda_snapshot_source-CorrectedChineseBrailleTableNames-4aa8735.pot] UnicodeDecodeError : 'gbk' codec
can't decode byte 0xad in position 2154: illegal multibyte sequence
Traceback (most recent call last):
  File "D:\git\nvda\.venv\lib\site-packages\SCons\Action.py", line 1279, in execute
    result = self.execfunction(target=target, source=rsources, env=env)
  File "D:\git\nvda\SConstruct", line 474, in makePot
    for lineNum, line in enumerate(inp):
UnicodeDecodeError: 'gbk' codec can't decode byte 0xad in position 2154: illegal multibyte sequence
scons: building terminated because of errors.
Deactivating NVDA Python virtual environment

Sorry, I do not have any other idea on the issue here.

@CyrilleB79

Copy link
Copy Markdown
Contributor

Hello @seanbudd and @cary-rowen

After thinking again to this PR, I think that it is not a good idea to change the name of Chinese Braille tables in English. Indeed it seems to me that it will be very difficult for non-Chinese translators to find a correct translation of the translatable strings introduced in this PR.
Wouldn't it rather be possible to keep the table name as is (i.e. close this PR) and contact Chinese translators so that they translate the table name correctly in Chinese?

For French we have modified the translations so that it corresponds to what is known in French, but only at the translation level.; the English name has not been modified. For example:

  • In English: "French (unified) grade 2"
  • In French: "Français (unifié) abrégé"

In French, this notion of Braille grade is not used and we use "abrégé" (contracted) to describe it.

What do you think?

@cary-rowen

Copy link
Copy Markdown
Contributor Author

Hi @CyrilleB79
I think it makes sense to use the names suggested in the Chinese national standard documents in NVDA.
Also, I'm a member of the Chinese translation team, and the note to the translator doesn't seem necessary because I'm well aware of what this change represents.
Seriously, as a Chinese translator, I'm confused by the original display name using "Grade1","Grade2" to distinguish the two tables, because no one in China knows such a name.
The NVDA Chinese team also intends to submit a new Chinese Braille table to Liblouis. Obviously this new Braille table should not be named "Grade3".
Anyway, thanks for your help.

@josephsl

Copy link
Copy Markdown
Contributor

Hi,

I'm raising a possible red flag here: even if native speakers know about what the original string and the translated text says, you should still provide translations for benefit of non-native speakers or folks who may not know about national standards. Therefore, I strongly urge you to add translator comments.

A possible compromise would be something I did when adding the 2006 edition of Korean braille to Libluis and NVDA: add the names to be used in China and elsewhere is parentheses. If not, you should still provide translator comments, as without that, this pull request will not proceed.

Thanks.

@cary-rowen

Copy link
Copy Markdown
Contributor Author

Hi, @josephsl
Since the translation contains Chinese strings, I defined utf-8 encoding at the beginning of the file, but the translation check still throws an error, and there is no way to go to the next step.
I might need some help, do you have any possible hints?

Thanks

@josephsl

josephsl commented May 11, 2022 via email

Copy link
Copy Markdown
Contributor

@cary-rowen

Copy link
Copy Markdown
Contributor Author

Hi, I did add translation comments in brailleTables.py.

@CyrilleB79

Copy link
Copy Markdown
Contributor

Hi, I did add translation comments in brailleTables.py.

@josephsl, to clarify things regarding the technical encoding issue:
The issue is the following:
In the source file brailleTables.py, @cary-rowen has added non-Ascii characters in one of the translator comment. The file is correctly encoded in UTF8 (without BOM) and the first line is the encoding specification as defined at Python 2 time. Though, the Translation comments check fails.
Could you help here?

@cary-rowen:
Regarding the translation of braille table names, I understand that grade 1/2 does not make sense for Chinese people. I will let people more familiar with Braille in various languages comment here, in case they have an idea of translator comment that could help clarifying things for non-Chinese translators.

@josephsl

josephsl commented May 11, 2022 via email

Copy link
Copy Markdown
Contributor

Comment thread source/brailleTables.py Outdated
@lukaszgo1

Copy link
Copy Markdown
Contributor

As to why the checkPot fails it is because Python open function opens the text files using the default ANSI code page on Windows and the ANSI code page on your system (and on AppVeyor) cannot correctly decode utf-8 text.
To fix this you need to specify explicit encoding for the open calls in sconstruct i.e. replace:
with open(potFn, "rt") as inp, open(tmpFn, "wt") as out:
with:
with open(potFn, "rt", encoding="utf-8") as inp, open(tmpFn, "wt", encoding="utf-8") as out:
and do the same for the open call in the checkPot file in the tests directory.

@cary-rowen

Copy link
Copy Markdown
Contributor Author

As to why the checkPot fails it is because Python function opens the text files using the default ANSI code page on Windows and the ANSI code page on your system (and on AppVeyor) cannot correctly decode utf-8 text.
Hi, @lukaszgo1

Thank you very much for your help, I followed your instructions, made these changes and it works perfectly.
However, this change seems to be outside the scope of this PR, do I need to open a separate PR to fix this?

Thanks Again

@lukaszgo1

Copy link
Copy Markdown
Contributor

@cary-rowen I'm not sure if this deserves a separate PR. @seanbudd What do you think?

@seanbudd

Copy link
Copy Markdown
Member

As to why the checkPot fails it is because Python open function opens the text files using the default ANSI code page on Windows and the ANSI code page on your system (and on AppVeyor) cannot correctly decode utf-8 text. To fix this you need to specify explicit encoding for the open calls in sconstruct i.e. replace: with open(potFn, "rt") as inp, open(tmpFn, "wt") as out: with: with open(potFn, "rt", encoding="utf-8") as inp, open(tmpFn, "wt", encoding="utf-8") as out: and do the same for the open call in the checkPot file in the tests directory.

While this is a small change, it is a separate concern and would be better fixed in a separate PR.

@cary-rowen cary-rowen force-pushed the CorrectedChineseBrailleTableNames branch from 558effd to 80e6013 Compare May 16, 2022 03:01
@AppVeyorBot

Copy link
Copy Markdown

See test results for failed build of commit a31c9f6019

@cary-rowen

Copy link
Copy Markdown
Contributor Author

Hi, @seanbudd
I applied the changes suggested by @lukaszgo1 and created #13698
Can you take a look?

@seanbudd seanbudd left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @cary-rowen.

Leaving out the changelog item as it just a minor string change

@seanbudd seanbudd merged commit ce4a67c into nvaccess:master May 19, 2022
@nvaccessAuto nvaccessAuto added this to the 2022.2 milestone May 19, 2022
@cary-rowen cary-rowen deleted the CorrectedChineseBrailleTableNames branch May 19, 2022 03:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Wrong display name for Chinese Braille output and input tables

7 participants