Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Translation] Add support for fuzzy tags in PoFileLoader #18175

Closed
wants to merge 1 commit into from

Conversation

Projects
None yet
5 participants
@nud
Copy link
Contributor

commented Mar 15, 2016

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #18161
License MIT
Doc PR -

The traditional gettext tools usually try to find similar strings when
updating translations. This results in some strings having a translation
but being marked as "fuzzy", even if the translation is not correct.

The expected result when a string is marked as fuzzy is that it should
not be used by the translation system. Using symfony, though, the
translations were used, which could result in "funny" messages being
displayed in the interface despite being often completely out of
context.

This commit discards messages in .po files that have a '#, fuzzy' flag.

This commit can (and imo should) be back-ported as-is to the 2.x branch.

@javiereguiluz javiereguiluz changed the title bug #18161 [Translation] Add support for fuzzy tags in PoFileLoader [Translation] Add support for fuzzy tags in PoFileLoader Mar 15, 2016

$item = $defaults;
$flags = array();
} elseif (substr($line, 0, 2) === '#,') {
$flags = array_map('trim', explode(',', substr($line, 2)));

This comment has been minimized.

Copy link
@nicolas-grekas

nicolas-grekas Mar 15, 2016

Member

wrong identation

@@ -104,7 +109,8 @@ protected function loadResource($resource)
}
}
// save last item
$this->addMessage($messages, $item);
if (!in_array('fuzzy', $flags))

This comment has been minimized.

Copy link
@nicolas-grekas

nicolas-grekas Mar 15, 2016

Member

missing curlyy brackets around and wrong indentation

@nicolas-grekas

This comment has been minimized.

Copy link
Member

commented Mar 15, 2016

👍 with minor comments

bug #18161 [Translation] Add support for fuzzy tags in PoFileLoader
The traditional gettext tools usually try to find similar strings when
updating translations. This results in some strings having a translation
but being marked as "fuzzy", even if the translation is not correct.

The expected result when a string is marked as fuzzy is that it should
not be used by the translation system. Using symfony, though, the
translations were used, which could result in "funny" messages being
displayed in the interface despite being often completely out of
context.

This commit discards messages in .po files that have a '#, fuzzy' flag.

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | 18161
| License       | MIT
| Doc PR        | -

@nud nud force-pushed the nud:po-skip-fuzzy branch from 772f429 to ede617d Mar 15, 2016

@fabpot

This comment has been minimized.

Copy link
Member

commented Mar 15, 2016

Thank you @nud.

fabpot added a commit that referenced this pull request Mar 15, 2016

bug #18175 [Translation] Add support for fuzzy tags in PoFileLoader (…
…nud)

This PR was submitted for the master branch but it was merged into the 2.3 branch instead (closes #18175).

Discussion
----------

[Translation] Add support for fuzzy tags in PoFileLoader

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #18161
| License       | MIT
| Doc PR        | -

The traditional gettext tools usually try to find similar strings when
updating translations. This results in some strings having a translation
but being marked as "fuzzy", even if the translation is not correct.

The expected result when a string is marked as fuzzy is that it should
not be used by the translation system. Using symfony, though, the
translations were used, which could result in "funny" messages being
displayed in the interface despite being often completely out of
context.

This commit discards messages in .po files that have a '#, fuzzy' flag.

This commit can (and imo should) be back-ported as-is to the 2.x branch.

Commits
-------

970b956 bug #18161 [Translation] Add support for fuzzy tags in PoFileLoader

@fabpot fabpot closed this Mar 15, 2016

@fabpot fabpot referenced this pull request Apr 29, 2016

Merged

Release v2.3.40 #18669

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.