Skip to content

Translate the API information page#7922

Merged
Alkarex merged 6 commits intoFreshRSS:edgefrom
aledeg:feat/translate-api-page
Sep 10, 2025
Merged

Translate the API information page#7922
Alkarex merged 6 commits intoFreshRSS:edgefrom
aledeg:feat/translate-api-page

Conversation

@aledeg
Copy link
Member

@aledeg aledeg commented Sep 6, 2025

Closes #6222

Changes proposed in this pull request:

  • Translate the api/index.php page

How to test the feature manually:

  1. n/a

Pull request checklist:

  • clear commit messages
  • code manually tested
  • unit tests written (optional if too hard)
  • documentation updated

Additional information can be found in the documentation.

@aledeg aledeg force-pushed the feat/translate-api-page branch 3 times, most recently from 79fe121 to d056881 Compare September 6, 2025 11:03
@Alkarex
Copy link
Member

Alkarex commented Sep 7, 2025

The /api/ endpoint(s) are not supposed to have cookies, sessions.
It could be based simply on the preference given by HTTP Accept-Language.

@aledeg aledeg force-pushed the feat/translate-api-page branch from d056881 to 5a2312b Compare September 7, 2025 20:36
@aledeg
Copy link
Member Author

aledeg commented Sep 7, 2025

I've made a change to use the preferred language from the request.

@aledeg aledeg force-pushed the feat/translate-api-page branch from 5a2312b to 5a8b6cd Compare September 7, 2025 20:49
<title><?= _t('api.information.title') ?></title>
<meta name="robots" content="noindex" />
<link rel="start" href="../i/" />
<script src="../scripts/api.js" defer="defer"></script>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are strings that need to be translated inside api.js

For example

greaderOutput.innerHTML = '⚠️ WARN: no <code>%2F</code> support, so some clients will not work!';

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, I'll look into that

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Alkarex what is the reason to have the testing done asynchronously in JS instead of doing it synchronously in PHP?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Alkarex what is the reason to have the testing done asynchronously in JS instead of doing it synchronously in PHP?

In order to more accurately simulate an API request coming from outside

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. Thank you!

@aledeg aledeg force-pushed the feat/translate-api-page branch 4 times, most recently from d70cdce to eff52b5 Compare September 9, 2025 17:38
@aledeg
Copy link
Member Author

aledeg commented Sep 9, 2025

I've finished the translation of the JS file. Only low-level error messages are left untouched.
I think it's ready, unless I forgot something.

@aledeg aledeg force-pushed the feat/translate-api-page branch from 047d670 to 31ae15f Compare September 9, 2025 18:54
@Alkarex Alkarex added this to the 1.27.1 milestone Sep 9, 2025
@Alkarex Alkarex added I18n 🌍 Translations API 🤝 API for other clients labels Sep 9, 2025
@aledeg aledeg force-pushed the feat/translate-api-page branch from dd396d7 to ceba340 Compare September 9, 2025 19:22
@math-GH
Copy link
Contributor

math-GH commented Sep 9, 2025

p/scripts/api.js has some "missing semicolon" notes but they do not fail the workflow check

@aledeg
Copy link
Member Author

aledeg commented Sep 9, 2025

p/scripts/api.js has some "missing semicolon" notes but they do not fail the workflow check

Thank you. I'll fix that.

@aledeg aledeg force-pushed the feat/translate-api-page branch from ceba340 to 0f48af4 Compare September 9, 2025 19:48
@Alkarex
Copy link
Member

Alkarex commented Sep 9, 2025

Arg, a forced push broke my upcoming changes. Please avoid :-)

@aledeg
Copy link
Member Author

aledeg commented Sep 9, 2025

Arg, a forced push broke my upcoming changes. Please avoid :-)

Sorry about that :'(

@Alkarex
Copy link
Member

Alkarex commented Sep 9, 2025

I just tried to complete the French, and some minor changes.
I had checked out the code to run make fix-all, to fix e.g. the semicolons

@Alkarex
Copy link
Member

Alkarex commented Sep 9, 2025

Conflict to be solved

@aledeg aledeg force-pushed the feat/translate-api-page branch from 2ae318a to 359346f Compare September 9, 2025 23:30
aledeg and others added 5 commits September 9, 2025 19:31
Co-authored-by: Inverle <inverle@proton.me>
Co-authored-by: maTh <1645099+math-GH@users.noreply.github.com>
@aledeg
Copy link
Member Author

aledeg commented Sep 9, 2025

Conflict to be solved

Done

@Alkarex Alkarex merged commit a1411c7 into FreshRSS:edge Sep 10, 2025
1 check passed
@aledeg aledeg deleted the feat/translate-api-page branch September 10, 2025 13:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

API 🤝 API for other clients I18n 🌍 Translations

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing i18n in /p/api/index.php

4 participants