Skip to content

Conversation

@Repkit
Copy link
Contributor

@Repkit Repkit commented Nov 17, 2015

Use case:
//Scan the php code from a string to find the latest gettext translations
$translations = Translations::fromPhpCodeString($string2translate);

//Get the translations of the code that are stored in a po file
$poTranslations = Translations::fromPoFile('en.po');

//Apply the translations from the po file to the translations, and merges header and comments but not references and without add or remove translations:
$translations->mergeWith($poTranslations, Translations::MERGE_HEADERS | Translations::MERGE_COMMENTS);

//Now save a po file with the result
$translations->toPoFile('en_new.po');

oscarotero added a commit that referenced this pull request Nov 17, 2015
return translations object from PhpCode::fromString
@oscarotero oscarotero merged commit ccf607d into php-gettext:master Nov 17, 2015
@oscarotero
Copy link
Member

Thanks. Good catch!

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.

2 participants