Skip to content

Research on the feasibility of using string hashing as the skeleton and unit ID for XLIFF files #20211

Description

@wmhn1872265132

Related issues, PRs or discussions

None

What is the current state of the codebase?

Currently, the unit IDs of document translation strings are randomly generated.

Why are changes required?

This has the following disadvantages:

  • Every time a new duplicate string appears, it needs to be retranslated, for example:
    • changes.md:
      ### Important notes
      ### New Features
      ### Changes
      ### Bug Fixes
      ### Changes for Developers
      Please refer to [the developer guide](https://download.nvaccess.org/documentation/developerGuide.html#API) for information on NVDA's API deprecation and removal process.
      #### Deprecations
    • userGuide.md:
      | Name |Desktop key |Laptop key |Description|
      | Name |key |Description|
      | Option | Behaviour |
      | Options | Disabled, Enabled |
      | Default | Disabled |
      | Default | Enabled |
  • When content is moved to another section, it needs to be retranslated, such as commit 6172254
  • I am unsure whether deleting some content and then restoring it would preserve the translations of those strings in Crowdin. If preservation is possible, this would also be a applicable scenario.
  • In extreme cases, if the English XLIFF document is lost and the file is regenerated, all previous translations for that file will be lost (this has already occurred during the migration of the current add-ons translation system).

What technical changes are required?

When a new string appears, use a hash of the English string (such as MD5, SHA1, or SHA256) as the filler content for the skeleton part and as the unit ID of the translated string. To ensure sufficient translation accuracy, the hash calculation should include the prefix and suffix of the string in that line. For compatibility reasons, currently translated strings can remain as they are.

Are the proposed technical changes API breaking?

No

Are there potential risks or issues with the proposed implementation?

Uncertain

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions