Use new pre-commit
script to detect and fix existing i18n
syntax issues
#9486
Labels
Lead: @mekarpeles
Issues overseen by Mek (Staff: Program Lead) [managed]
Priority: 3
Issues that we can consider at our leisure. [managed]
Theme: Internationalization
Making OpenLibrary work for both foreign-language users and books. [managed]
Type: Epic
A feature or refactor that is big enough to require subissues. [managed]
Type: Feature Request
Issue describes a feature or enhancement we'd like to implement. [managed]
Problem
The new
detect_missing_i18n
script by @pidgezero-one has given us a super helpful list ofi18n
syntaxing issues throughout the codebase and/or validi18n
that accidentally gets flagged by the script.These files are listed in
EXCLUDE_LIST
indetect_missing_i18n.py
.Proposal & Constraints
Once the PR (#9428) is merged, I propose going through the full list of excluded files myself and making any changes where needed, either fixing
i18n
syntax or adjusting distribution of text to avoid accidental flags of the script. I'll also make any updates to thei18n
Developer's Guide where needed as a result of edge-cases I discover in the process.Related files
detect_missing_i18n.py
Issue phases & sub-PRs
warn
regex to avoid accidentally flagging Python, escape remaining Python files as needed.i18n
warn regex and escape relevant files #9502i18n
syntax updates, i.e. adding$_(" ")
or$_(' ')
to all plain text ortitle
/alt
/placeholder
attributesi18n
syntax additions #9505i18n
syntax updates that include variables, i.e.$_('%(count)d titles by %(author)s', count=num_titles, author=author_name)
i18n
syntax additions with variables #9506i18n
syntax updates that include nested HTML, i.e.$:_('Please <a href="">click here</a>')
i18n
syntax additions with nested HTML #9507i18n
exclude list and add remaining exceptions where needed #9508i18n
rendering foredition_count
in lazy work preview #9708Stakeholders
@pidgezero-one
Instructions for Contributors
The text was updated successfully, but these errors were encountered: