jrgong
(jrgong)
Novembre 11, 2025, 7:13
1
Existe-t-il un moyen d’accéder aux versions localisées du contenu publié via l’API ?
J’ai essayé via des requêtes GET en ajoutant ?tl=en comme paramètre, mais j’obtiens le contenu original, pas la traduction, en retour.
2 « J'aime »
pfaffman
(Jay Pfaffman)
Novembre 11, 2025, 7:36
2
En général, si vous souhaitez en savoir plus sur l’API, le moyen le plus rapide est de Ingénierie inverse de l’API Discourse
1 « J'aime »
pmusaraj
(Penar Musaraj)
Novembre 11, 2025, 7:54
3
Cela fonctionne déjà pour moi, par exemple le sujet actuel avec ?tl=fr donne la bonne réponse, remarquez que cooked est en français :
nat
(Natalie T)
A scindé ce sujet ()
Novembre 14, 2025, 2:28
4
Un message a été divisé dans un nouveau sujet : Tl=lang crawler view not showing posts in lang
jrgong
(jrgong)
Novembre 11, 2025, 7:56
5
J’ai essayé exactement cela via le point de terminaison /posts/id.json, mais j’obtiens seulement la version originale dans cooked.
Pourriez-vous vérifier de votre côté ? https://meta.discourse.org/posts/1887991.json?tl=fr
pmusaraj
(Penar Musaraj)
Novembre 11, 2025, 7:57
6
Ce point de terminaison fonctionne pour moi, il renvoie cuit en français. Si je passe à tl=es, il renvoie cuit en espagnol.
pmusaraj
(Penar Musaraj)
Novembre 11, 2025, 8:03
8
Est-ce que vous appelez ces points de terminaison à partir d’un utilisateur spécifique ? De mon côté, je fais les requêtes de manière anonyme.
jrgong
(jrgong)
Novembre 11, 2025, 8:08
9
Oui, je les fais pendant que je suis connecté. Et c’est en fait ce que j’essaie d’accomplir car je veux pouvoir OBTENIR des publications de catégories fermées dans notre forum.
1 « J'aime »
nat
(Natalie T)
Novembre 12, 2025, 1:41
10
Le paramètre tl ne fonctionne que pour les utilisateurs anonymes.
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 « J'aime »
jrgong
(jrgong)
Novembre 12, 2025, 8:30
11
Merci pour la confirmation ! Je vais modifier le premier message pour en faire une demande de fonctionnalité.