# ErreurNoMéthode après mise à jour

**URL:** <https://meta.discourse.org/t/nomethoderror-after-upgrade/315073>\
**Category:** Bug\
**Tags:** ai, fixed\
**Created:** [Juillet 5, 2024, 2:27 UTC](https://meta.discourse.org/t/nomethoderror-after-upgrade/315073 "2024-07-05T02:27:52Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![pangbo](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pangbo/32/538562_2.png) [@pangbo](https://meta.discourse.org/u/pangbo)\
**Post date:** [Juillet 5, 2024, 8:35 UTC](https://meta.discourse.org/t/nomethoderror-after-upgrade/315073/2 "2024-07-05T08:35:40Z")

</div>

Salut,

D’après l’URL de votre profil, je suppose que la locale de votre site Discourse est définie sur le chinois simplifié. J’ai rencontré le même problème. La cause du problème est que le chinois simplifié est codé en « zh\_CN » dans les paramètres du site, mais la clé dans LocaleSiteSetting est « zh », ce qui entraîne une incohérence.

J’ai créé une PR pour résoudre ce problème :

> <https://github.com/discourse/discourse-ai/pull/705>
>
> The latest AI plugin encounters an error when using the editor AI assistant's tr…anslation feature if the site setting or user custom language is set to Simplified Chinese (zh\_CN).
> 
> I noticed a similar issue being reported on meta: \[NoMethodError after upgrade\](https://meta.discourse.org/t/nomethoderror-after-upgrade/315073).
> 
> The error originates from:
> https://github.com/discourse/discourse-ai/blob/d555f18c6fadd4676d70ddd44f0bf63f2a8e8228/lib/ai\_helper/assistant.rb#L32
> 
> The cause of the problem is that Simplified Chinese is coded as "zh\_CN" in the site settings, but the key in LocaleSiteSetting is "zh", leading to a mismatch.
> 
> This PR fixes the issue by copying the approach used in Discourse core:
> 
> https://github.com/discourse/discourse/blob/bb0daa33cd93eeffb230689d1daacd737f61b2e7/app/models/locale\_site\_setting.rb#L11

---

_[View the full topic](https://meta.discourse.org/t/nomethoderror-after-upgrade/315073)._
