jrgong
(jrgong)
Novembro 11, 2025, 7:13pm
1
Existe alguma forma de acessar versões localizadas de conteúdo pronto via API?
Tentei fazer requisições GET adicionando ?tl=en como parâmetro, mas recebo o conteúdo original, não a tradução, como retorno.
2 curtidas
pfaffman
(Jay Pfaffman)
Novembro 11, 2025, 7:36pm
2
Em geral, se você quiser saber mais sobre a API, a maneira mais rápida é Engenharia reversa da API do Discourse
1 curtida
pmusaraj
(Penar Musaraj)
Novembro 11, 2025, 7:54pm
3
Isso já funciona para mim, por exemplo, o tópico atual com ?tl=fr dá a resposta certa, note que cooked está em francês:
nat
(Natalie T)
Dividiu este tópico
Novembro 14, 2025, 2:28am
4
jrgong
(jrgong)
Novembro 11, 2025, 7:56pm
5
Tentei exatamente isso através do endpoint /posts/id.json, mas recebo apenas a versão original em cooked.
Você poderia verificar do seu lado? https://meta.discourse.org/posts/1887991.json?tl=fr
pmusaraj
(Penar Musaraj)
Novembro 11, 2025, 7:57pm
6
Esse endpoint funciona para mim, ele retorna “cooked” em francês. Se eu mudar para tl=es, ele retorna “cooked” em espanhol.
pmusaraj
(Penar Musaraj)
Novembro 11, 2025, 8:03pm
8
Você está chamando esses endpoints de um usuário específico? Da minha parte, estou fazendo as solicitações anonimamente.
jrgong
(jrgong)
Novembro 11, 2025, 8:08pm
9
sim, eu os faço enquanto estou logado. E é realmente o que estou tentando alcançar, já que quero poder OBTER posts de categorias fechadas em nosso fórum.
1 curtida
nat
(Natalie T)
Novembro 12, 2025, 1:41am
10
O parâmetro tl funciona apenas para anônimos.
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 curtidas
jrgong
(jrgong)
Novembro 12, 2025, 8:30am
11
Obrigado pela confirmação! Vou editar o primeiro post para transformá-lo em uma solicitação de recurso.