turquoiseowl / i18n

Smart internationalization for ASP.NET
Other
556 stars 156 forks source link

Merging translations from existing template file #330

Open Taesti opened 7 years ago

Taesti commented 7 years ago

In the wiki this is mentioned

After the new template is constructed, any locales that exist inside the locale folder (or as defined by the i18n.AvailableLanguages semi-colon-delimited web.config setting) are automatically merged with the template, so that new strings can be flagged for further translation.

But this seems to not be true. The template is generated from the Dictionary<string, TemplateItem> and saved to a .pot file, then the translations are merged with this dictionary generated by the NuggetFinder, not with the generated template.

Is there a way to merge the existing translations given a .pot file?

The use case here is our build server generating the .pot files with PostBuild. After deployment I want to merge the existing translations with the potentially added nuggets from the new build. The .po files can be live edited in our system, so the workflow of generating a .pot file, translating it and then deploying all the generated translations is not followed.

It seems the only option is to implement my own INuggetFinder that parses the .pot back to TemplateItems?

turquoiseowl commented 7 years ago

Sorry, not quite with you, unless you're saying you need the old POT file merged with the new one?