Page MenuHomePhabricator

Move partner and collection descriptions into the codebase
Open, MediumPublic

Description

Background
The Library Card platform interface is translatable through translatewiki.net - this has been done for a number of languages already and is an expected workflow for folks translating Wikimedia tools. The Library Card, however, has some elements which currently can't be translated there, specifically strings entered by library staff in the Django admin interface. These strings can't be surfaced in the normal way, so we don't currently have a good way to enable community translations of these vital elements, nor to highlight that a translation is outdated.

We considered solving this issue by moving descriptions to Meta (T171874) but this ended up being a technically complex solution, and would still result in translatable content being split across two locations.

We could instead move these strings into the codebase, such that they can be picked up by TranslateWiki.

Acceptance criteria

  • Partner descriptions (both short and long) are translatable through TranslateWiki
  • Collection descriptions are translatable through TranslateWiki
  • There is a process by which library staff can add new descriptions*

*This is more of a consideration while implementing this - try not to make the data structures too obscure or complex! We don't need to add new publishers often but it happens 3-10 times per year. If we can do that without needing an engineer to work on it that would be ideal.

Event Timeline

Notes from our engineering meeting today:

  • Extract the text, placing it in text files, then adjust the views to pull the variables from the files in more or less the same way.
    • Templates can therefore mostly remain unchanged.
  • Then we would just edit a file in Github to update them.
  • Process would be to first create the resources in /admin, then reference the primary keys in the files
  • We could add some Wikitext linting to those files.
  • Fixtures would also be an option, but not so useful since we don't want to be able to write back to the files from the site
    • Could also have a cron which syncs the database to the files, but this is a different way of thinking about the problem. These columns contribute a lot of data to the database, so removing them would be preferable.
  • Migration to run through and dump the text into files, then a subsequent migration to drop the data
  • We might need to do some work with TranslateWiki to ensure that it's looking in the right places to pick up these files too.
  • Tags are distinct so we should split this out to a separate task.
Samwalton9 renamed this task from Move partner descriptions, collection descriptions, and tags into the codebase to Move partner and collection descriptions into the codebase.Mar 18 2021, 2:15 PM
Samwalton9 lowered the priority of this task from High to Medium.
Samwalton9 updated the task description. (Show Details)

Moving this off the kanban now we have more granular subtasks.