[Translator] Add comments when dumping po files#30909
Merged
fabpot merged 1 commit intosymfony:masterfrom Apr 6, 2019
Merged
Conversation
Member
|
I like this PR. Thank you Just and FYI: In xliff we have We maybe should have 4 standard thing keys that are shared over all dumpers/loaders. |
Member
|
Looks like the tests are broken by the features introduced in this PR. @deguif Can you have a look? |
Contributor
Author
|
Please don't merge, I will rebase it once #30919 will get merged. |
fabpot
added a commit
that referenced
this pull request
Apr 6, 2019
This PR was merged into the 3.4 branch. Discussion ---------- [Translator] Fix wrong dump for PO files | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | When working on #30909 I encountered this bug. Currently the tests were passing, because the po fixture file contained only one translation. Commits ------- b54abfc Fix wrong dump for PO files
Member
|
@deguif You can rebase this one now. |
Contributor
Author
|
@fabpot this should be mergeable, test failures are not related. |
fabpot
approved these changes
Apr 6, 2019
Member
|
Thank you @deguif. |
fabpot
added a commit
that referenced
this pull request
Apr 6, 2019
This PR was merged into the 4.3-dev branch. Discussion ---------- [Translator] Add comments when dumping po files | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | ? <!-- please add some, will be required by reviewers --> | Fixed tickets | #29962 | License | MIT | Doc PR | This code ```php $catalogue = new MessageCatalogue('fr'); $dumper = new PoFileDumper(); $catalogue->set('key.one', 'First key', 'custom'); $catalogue->setMetadata('key.one', ['sources' => 'src/file_1', 'comments' => 'Comment', 'flags' => 'fuzzy'], 'custom'); $catalogue->set('key.second', 'Second key', 'custom'); $catalogue->setMetadata('key.second', ['sources' => ['src/file_1', 'src/file_2'], 'comments' => ['Comment 1', 'Comment 2'], 'flags' => ['fuzzy', 'another']], 'custom'); $dumper->dump($catalogue, [ 'path' => 'xxx', ]); ``` Will produces this output: ``` msgid "" msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: fr\n" # Comment #, fuzzy #: src/file_1 msgid "key.one" msgstr "First key" # Comment 1 # Comment 2 #, fuzzy,another #: src/file_1 src/file_2 msgid "key.second" msgstr "Second key" ``` Commits ------- 31b3a55 Add comments when dumping po files
This was referenced Apr 25, 2019
fabpot
added a commit
that referenced
this pull request
Apr 29, 2019
This PR was merged into the 4.3-dev branch. Discussion ---------- [Translator] Add sources when dumping qt files | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | This PR implements similar functionality as #30909, but for Qt files. Currently, only the Qt element `location` is supported, so only `sources` metadata is included in the dump. Commits ------- ff7577d Add sources when dumping qt files
fabpot
added a commit
that referenced
this pull request
May 7, 2019
…php files (Stadly) This PR was squashed before being merged into the 4.3-dev branch (closes #31249). Discussion ---------- [Translator] Set sources when extracting strings from php files | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | Set metadata about filenames and line numbers when extracting translatable strings from php files. This PR complements #30909 and #31248, as those PRs implement support for dumping the filenames and line numbers to Po and Qt file formats. Commits ------- f05d4e4 [Translator] Set sources when extracting strings from php files
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This code
Will produces this output: