actions icon indicating copy to clipboard operation
actions copied to clipboard

gettext-template: Update POTFILES if there are removed or added files that includes translatable strings

Open ryonakano opened this issue 5 years ago • 1 comments

Prerequisites

  • [x] I have searched open and closed issues for duplicates.

Feature

Is your feature request related to a problem? Please describe. スクリーンショット 2020-06-24 19 36 46 Editing POTFILES is not automated at the moment, so if we forget to update POTFILES when adding/removing files that include translatable strings, Gettext Actions will fail.

Describe the solution you'd like It would be useful if the Gettext Actions can detect added/removed files from a project, check if they include translatable strings (_(), ngettext (), dgettext (), etc.), and if so remove/add the path to them from POTFILES automatically.

Existing work N/A

Describe alternatives you've considered N/A

Additional context N/A

ryonakano avatar Jun 24 '20 10:06 ryonakano

I'm still not able to work on this but left a regex to detect translatable strings like _("Hello world!") or ngettext ("%i item", "%i items", item_count).printf (item_count) in vala code:

((|Q|N|NC|C)\_|(d|dc|n|dn)gettext|dpgettext(2)?)\s?\("

ryonakano avatar Oct 07 '20 05:10 ryonakano