Opened 3 years ago
Closed 3 weeks ago
#5891 closed enhancement (fixed)
If a blank or tab is at the end of an original line, mark it in the original
Reported by: | psmits1567 | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Component: | Translate Site & Plugins | Keywords: | needs-design |
Cc: |
Description
Currently a lot of fuzzy records are created, because the translation misses a blank or tab at the end of the translated line.
As it is possible to mark chars in the original, it would be an improvement if a blank or tab at the end of an original line is marked.
Attachments (1)
Change History (9)
#3
@
3 years ago
Generic things like this, that are in the GlotPress core, and not specific to WordPress.org would be better reported to https://github.com/glotpress/glotpress-wp
There's potentially some things we could do here though on WordPress.org, such as running the fixer over fuzzy matches to see if it can 'upgrade' the string to respect the new original..
#4
@
3 years ago
If the fixer coud resolve those issues, that would already reduce the amount of work. But I like preventing those issues.
I also suspect that this happens via import of translations. So maybe an additional check, when importing translations could also reduce those fuzzies.
#5
@
3 years ago
Just noting I added some test strings to test-plugin-3 in plugins2624933 to visualise this.
You'll see that leading/trailing spaces aren't highlighted in any way.
In regular document editors with "show hidden characters" enabled, you'd see a feint dot, usually slightly vertically centered.
I think it'd be worth taking a "show spaces" or at least a "show leading/trailing spaces" enhancement to GlotPress.
It doesn't look like the lack of a space in the translation trips any warnings.
#6
follow-up:
↓ 7
@
3 years ago
Correct no warnings are shown, but if you do not add the blank at the end of the line, the translation is incorrect. Mostly the blank is added intentionally by the developer.
#7
in reply to:
↑ 6
@
3 years ago
Replying to psmits1567:
Correct no warnings are shown, but if you do not add the blank at the end of the line, the translation is incorrect. Mostly the blank is added intentionally by the developer.
Yeah, I agree, I think there should be a warning added for that too.
#8
@
3 weeks ago
- Resolution set to fixed
- Status changed from new to closed
This problem has been resolved. If you take a look at the strings in the image above, it has the tab, leading/trailing space and new line marks.
These are the strings in the Dutch .po file.
#: plugin.php:58 msgid "" "\t String with whitespace at the start and end.\n" "With a new line in between.\t " msgstr "" "\t String met whitespace aan het begin en einde.\n" "Met een nieuwe regel er tussenin.\t " #: plugin.php:57 msgid "\t String with whitespace at the start and end. \t" msgstr "\t String met whitespace aan het begin en einde. \t" #: plugin.php:56 msgid " String with a space at the start" msgstr " String met een spatie aan het begin"
- The first string ends with a space, so it should only show this space mark.
- The second string starts and ends with a tab, so it should not show a space mark.
- The third string starts with an empty space, so it should only show this space mark.
... or in the beginning of the string, by the way.