Skip to content

i18n: Add Telugu (te) translations for missing UI strings - Fixes #12216#12218

Merged
mekarpeles merged 7 commits intointernetarchive:masterfrom
VemuriHaritha:master
Apr 6, 2026
Merged

i18n: Add Telugu (te) translations for missing UI strings - Fixes #12216#12218
mekarpeles merged 7 commits intointernetarchive:masterfrom
VemuriHaritha:master

Conversation

@VemuriHaritha
Copy link
Copy Markdown
Contributor

What issue does this PR close?

Closes #12216

What does this PR achieve?

This PR adds missing Telugu (te) translations to improve localization support in Open Library.


Technical

  • Updated openlibrary/i18n/te/messages.po
  • Added translations for multiple UI components including:
    • Home pages
    • Navigation menus
    • Login & account pages
    • Book details and metadata sections
    • Lists, authors, and edition views
  • Maintained correct gettext formatting (msgid, msgstr, plural forms)

Testing

To verify:

  1. Run the application locally using Docker
  2. Switch language to Telugu (/account?lang=te or UI language selector)
  3. Navigate through:
    • Home page
    • Book page
    • Login page
    • Lists & Authors
  4. Confirm Telugu translations are visible

Screenshot

Before:

Screenshot 2026-03-29 142238 After: {8EAC8948-7FB2-49F2-8F19-B698B347D8A0} image image

Notes

This improves accessibility for Telugu-speaking users and enhances internationalization coverage.

@mekarpeles mekarpeles self-assigned this Mar 31, 2026
@mekarpeles
Copy link
Copy Markdown
Member

Great job, thank you :)

@mekarpeles
Copy link
Copy Markdown
Member

Copilot remarks there are some issues w/ CI that need to be resolved:

The failing job is the Python test suite run from .github/workflows/python_tests.yml (ref 4a10ffb225f9c256fb5a357a7ea386bec87caa6f), and it’s failing in the i18n HTML-structure lint:

  • Failing tests: openlibrary/i18n/test_po_files.py::test_html_format for locale te (Telugu)
  • Symptom: AssertionError: assert 1 == 0 / assert 3 == 2 where the test compares the parsed HTML/XML trees for msgid vs msgstr and the number of child elements differs (len(root) mismatch).
  • Root cause: one or more Telugu translations changed/omitted HTML tags present in the English source strings (e.g., <a ...>...</a>, <em>, <b>), so the translation no longer has the same tag structure as the source.

What to change (recommended fix)

Update the Telugu messages.po entries so that each msgstr preserves the same HTML tag structure as its msgid (same elements, same nesting, and the same attribute names on each tag). The actual text can change, but the markup must remain structurally equivalent.

The logs show these failing msgids (all under locale te), so fix the corresponding msgstrs in:

openlibrary/i18n/te/messages.po (at ref 4a10ffb225f9c256fb5a357a7ea386bec87caa6f)

1) Link preserved

msgid

If you work at a library and are interested to find out more about lending ebooks through Open Library, please <a href="/contact">get in touch with us</a>!

Fix: Ensure the Telugu msgstr still contains exactly one <a> element with href="/contact" and closing </a>.

2) JS link preserved

msgid

If you'd like to create a new, different Open Library account, you'll need to <a href="javascript:;" onclick="document.forms['logout'].submit()">log out</a> and start the signup process afresh.

Fix: Ensure msgstr includes one <a> tag with both attributes href and onclick (attribute values can be identical to msgid; safest is to keep them unchanged) and </a>.

3) Placeholder link preserved

msgid

Your account has been activated already. Please <a href="%s">log in to continue</a>.

Fix: Ensure msgstr includes <a href="%s">...</a>.

4) Placeholder link with single quotes preserved

msgid

Yay! Your email address has been verified. Please <a href='%s'>log in to continue</a>.

Fix: Ensure msgstr includes <a href='%s'>...</a>.

5) Em/b tags preserved (structure count mismatch 3 vs 2)

msgid

One moment... It looks like we already have <em>some potential matches</em> for <b>%s</b> by <b>%s</b>.

Fix: Ensure msgstr includes exactly: one <em>...</em> and two <b>...</b> tags, with the %s placeholders inside the <b> tags.

If you intentionally need different markup

There’s an escape hatch already built into the test:

In openlibrary/i18n/test_po_files.py it skips the tree-structure assertion when the translation starts with:

<!-- i18n-lint no-tree-equal -->

So an alternative (less ideal) fix is to prefix the specific Telugu msgstr with that comment, e.g.

msgstr "<!-- i18n-lint no-tree-equal -->...your translation..."

Use this only if preserving the tag structure is genuinely impossible/undesirable, because it disables the safety check for that string.

Why this will fix CI

test_html_format parses msgid and msgstr as XML and asserts structural equality via trees_equal() (see openlibrary/i18n/test_po_files.py in the same ref). Preserving the same tag nesting and attribute keys makes len(root) and child traversal match again, eliminating the 5 failures.

@mekarpeles mekarpeles added Needs: Submitter Input Waiting on input from the creator of the issue/pr [managed] labels Mar 31, 2026
@VemuriHaritha
Copy link
Copy Markdown
Contributor Author

Thank you for the review @mekarpeles! I'll fix the HTML tag structure issues in the failing translations right away and update the PR.

@github-actions github-actions Bot removed the Needs: Submitter Input Waiting on input from the creator of the issue/pr [managed] label Mar 31, 2026
@VemuriHaritha
Copy link
Copy Markdown
Contributor Author

Hi @mekarpeles, I've fixed all 5 HTML tag structure issues. Please review when you get a chance. Thank you!

@github-actions github-actions Bot added the Needs: Response Issues which require feedback from lead label Mar 31, 2026
@mekarpeles mekarpeles merged commit 12c1bbf into internetarchive:master Apr 6, 2026
3 checks passed
@mekarpeles
Copy link
Copy Markdown
Member

Nice job, thank you!

@VemuriHaritha
Copy link
Copy Markdown
Contributor Author

Thank you sir

shoaib-inamdar pushed a commit to shoaib-inamdar/openlibrary that referenced this pull request Apr 7, 2026
IvanPisquiy06 pushed a commit to IvanPisquiy06/openlibrary that referenced this pull request Apr 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs: Response Issues which require feedback from lead

Projects

None yet

Development

Successfully merging this pull request may close these issues.

UI: Not all text is translated to Telugu (te)

2 participants