jrgong
(jrgong)
2025 年 11 月 11 日午後 7:13
1
In our use case, we are trying to GET localized posts from closed categories in our forum.
It would be a neat addition for the REST API to support ?tl=en as a parameter to pull the translated version of the cooked post.
Currently, the tl param only works for anons.
「いいね!」 1
pfaffman
(Jay Pfaffman)
2025 年 11 月 11 日午後 7:36
2
In general, if you want to find out about the API, the fastest way is to Reverse engineer the Discourse API
「いいね!」 1
pmusaraj
(Penar Musaraj)
2025 年 11 月 11 日午後 7:54
3
This already works for me, for example the current topic with .json?tl=fr gives the right response, notice that cooked is in French:
pmusaraj
(Penar Musaraj)
2025 年 11 月 11 日午後 7:56
4
Ah but if I make a request as a crawler, I get this:
Title is in French but not the posts. This looks like a regression, can you have a look @nat ?
「いいね!」 2
jrgong
(jrgong)
2025 年 11 月 11 日午後 7:56
5
I tried exactly that via /posts/id.json endpoint, but get just the original version in cooked.
Could you check on your end? https://meta.discourse.org/posts/1887991.json?tl=fr
pmusaraj
(Penar Musaraj)
2025 年 11 月 11 日午後 7:57
6
That endpoint works for me, it returns cooked in French. If I switch to tl=es, it returns cooked in Spanish.
pmusaraj
(Penar Musaraj)
2025 年 11 月 11 日午後 8:03
8
Are you calling these endpoints from a specific user? On my end, I am making the requests anonymously.
jrgong
(jrgong)
2025 年 11 月 11 日午後 8:08
9
yep, I do them while logged in. And that’s actually what I am trying to achieve since I want to be able to GET posts from closed categories in our forum.
「いいね!」 1
nat
(Natalie T)
2025 年 11 月 12 日午前 1:41
10
The tl param only works for anons.
site_settings:
allow_bulk_invite: "Allow bulk invites by uploading a CSV file"
disabled: "disabled"
display_local_time_in_user_card: "Display the local time based on a user's timezone when their user card is opened."
censored_words: "Words that will be automatically replaced with ■■■■"
delete_old_hidden_posts: "Auto-delete any hidden posts that stay hidden for more than 30 days."
default_locale: "The default language of this Discourse instance. You can replace the text of system generated categories and topics at <a href='%{base_path}/admin/customize/site_texts' target='_blank'>Customize / Text</a>."
allow_user_locale: "Allow users to choose their own language interface preference"
set_locale_from_accept_language_header: "Set interface language for anonymous users from their web browser's language headers"
set_locale_from_cookie: "Allows setting an anonymous user's locale via the 'locale' browser cookie"
set_locale_from_param: "Allows setting an anonymous user's locale via the 'tl' URL param, e.g. ?tl=es"
support_mixed_text_direction: "Support mixed left-to-right and right-to-left text directions"
min_post_length: "Minimum allowed post length in characters (excluding personal messages)"
min_first_post_length: "Minimum allowed first post (topic body) length (excluding personal messages)"
prevent_uploads_only_posts: "Don't count upload markdown code when checking for min post length"
min_personal_message_post_length: "Minimum allowed post length in characters for messages (both first post and replies)"
max_post_length: "Maximum allowed post length in characters"
topic_featured_link_enabled: "Allows users to associate a feature link with their topics. When turned on, topics can have a highlighted link attached, which is publicly visible and can be edited if the user has sufficient permissions. The feature link can enhance a topic's comprehensibility by providing related additional content."
show_topic_featured_link_in_digest: "Show the topic featured link in the digest email."
min_topic_views_for_delete_confirm: "Minimum amount of views a topic must have for a confirmation popup to appear when it gets deleted"
min_topic_title_length: "Minimum allowed topic title length in characters"
「いいね!」 3
jrgong
(jrgong)
2025 年 11 月 12 日午前 8:30
11
Thx for the confirmation! I will edit first post into a feauture request then