It would be useful to be able to process all modules and themes and directly add missing strings to the locales_source table.

See #361614: Make locale() read only?.

Issue fork potx-361615

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

gábor hojtsy’s picture

Version: 6.x-2.x-dev » 6.x-3.x-dev

I agree it would be a good idea to provide an option to be able to fill in the database with strings not translated yet, so users could use potx as a tool to evaluate their translation completeness as well.

gábor hojtsy’s picture

Title: Directly import missing strings » Provide option to record untranslated strings in database

Retitling.

owen barton’s picture

Version: 6.x-3.x-dev » 7.x-1.x-dev
Status: Active » Needs review
StatusFileSize
new683 bytes

This is a very rough patch. I presume some kind of interface control would be needed - is this a checkbox on the form? I am also not quite sure what value to use for the version column.

charginghawk made their first commit to this issue’s fork.

charginghawk’s picture

Version: 7.x-1.x-dev » 8.x-1.x-dev
Issue summary: View changes
StatusFileSize
new206 KB

This is an old issue, but I wanted to extract translatable strings from the codebase and save them to locales_source, so here we are. Here's what the MR does:

  1. Adds a new database table, potx_locales_filesystem_location, you can join with locales_source, that saves the locale id, the module / theme name, the filepath within the module/theme, and the filepath to the module/theme.
  2. Adds a function, _potx_write_to_locales_source(), that adds strings to locales_source if they aren't there already, and updates the table mentioned above. This function is called automatically from _potx_build_files().
  3. Adds support for TMGMT, a source plugin viewable at /admin/tmgmt/sources/potx_locale/default, where you can see the extracted strings if they have info in potx_locales_filesystem_location, and filter by path and name.
  4. It doesn't work for drush. It only works if you use the UI to extract strings at /admin/config/regional/translate/extract. That probably should be fixed.

Screenshot of new Translation Manangement Tools interface