Fallenbagel / jellyseerr

Fork of overseerr for jellyfin support.
https://docs.jellyseerr.dev/
MIT License
3.47k stars 218 forks source link

wrong productioncountries value translation #826

Closed theggs closed 2 months ago

theggs commented 2 months ago

Description

In production countries field, value 中国香港特别行政区 is transformed to 香港, which should keep the oriainal value 中国香港特别行政区

Version

1.9.2

Steps to Reproduce

  1. Set display language to 简体中文
  2. search and go to detail page of movie 'Shaolin Soccer'
  3. check the value of 出品国家(production countries)

Screenshots

When viewing the details of movie 'Shaolin Soccer' in language Chinese, we can see the production country is filled with 香港

image

While the field in TMDB (https://www.themoviedb.org/movie/11770?language=zh-CN) it is 中国香港特别行政区

image

I can see in the browser, Jellyseerr's response of /movie/{movie_id} the locale value of the field is 中国香港特别行政区.

image

I don't why it becomes 香港 as the final display of result.

It should be 中国香港特别行政区 - the same result of TMDB's information.

Logs

No response

Platform

desktop

Device

Macbook Pro 16'

Operating System

MacOS 14.5

Browser

Chrome 125

Additional Context

No response

Code of Conduct

Fallenbagel commented 2 months ago

We don't use the values from tmdb for the purpose of localisation. It's handled by @formatjs/react-intl.

And this is their localised name for that production country.

Here is the code snippet:

https://github.com/Fallenbagel/jellyseerr/blob/develop/src%2Fcomponents%2FMovieDetails%2Findex.tsx#L769-L791

theggs commented 2 months ago

I see, it come from JS internal function Intl.DisplayNames.. The translation is fine if standalone. But it is not good to use this translation as 'countries'.

Is there a reason why we don't use the displayname returned by TMDB firstly?

Fallenbagel commented 2 months ago

The translation in fine if standalone. But it is not good to use this translation as 'countries'.

It is the translation done by that package. So you should raise an issue with them.

Is there a reason why we don't use the displayname returned by TMDB firstly?

Yes. For localisation.

theggs commented 2 months ago

@Fallenbagel The displayname returned by TMDB is already localized. And it seems already considered the semantic in this situation. Can jellyseerr use it firstly?

Fallenbagel commented 2 months ago

@Fallenbagel The displayname returned by TMDB is already localized. And it seems already considered the semantic in this situation. Can jellyseerr use it firstly?

The production name returned by tmdb api is not localised to the display language that is set. It returns the iso code and the display name of that country in english. That is not localised. image

As you can see the production country names are in english and this was after requesting for a movie in japanese lang.

below you can see the localised country names when react-intl is used. image

Therefore,

you should raise an issue with them. [ react-intl package ]

theggs commented 2 months ago

@Fallenbagel It is not a Intl.displaynames issue. React-Intl use JavaScript’s internal function , and the translation is ok in generaral speaking.

While it is not suitable if the context is 'production countries'. Let me give an example to make it easier to understand.

const regionNamesInEnglish = new Intl.DisplayNames(['en'], { type: 'region' });
console.log(regionNamesInEnglish.of('GU'));

> "Guam"

It is true that "GU" stand for "Guam". But it is not suitable to say it is a country. Hong Kong is a special area. It is a special administrative region(SAR). It publishes movies as a standalone region. When in this context, it is called 'Hong Kong SAR, China' -- Just as how TMDB call it.

gauthier-th commented 2 months ago

Hi @theggs I tried to replicate your issue on the latest version (1.9.2) in three different display language: English, Chinese and French. Here is the results:

English: image

Chinese: image

French: image

I can't replicate your issue in these 3 languages, the production country is "Hong Kong SAR, China".

theggs commented 2 months ago

That's strange. I am also running version 1.9.2

Fallenbagel commented 2 months ago

I just tested as well.

Screenshot_20240624_180958_Firefox Beta.jpg

Screenshot_20240624_181231_Firefox Beta.jpg

Fallenbagel commented 2 months ago

Develop as well.

Screenshot_20240624_181459_Firefox Beta.jpg

Screenshot_20240624_181507_Firefox Beta.jpg

theggs commented 2 months ago

That's quite strange. @gauthier-th @Fallenbagel What OS and browser did you guys use?

Fallenbagel commented 2 months ago

That's quite strange. @gauthier-th @Fallenbagel What OS and browser did you gus used?

I'm using docker + firefox

gauthier-th commented 2 months ago

That's quite strange. @gauthier-th @Fallenbagel What OS and browser did you gus used?

I'm using docker + firefox

Same thing for me, Docker and Firefox (I tried mobile and desktop)

theggs commented 2 months ago

I can get a good result in MacOS + firefox

image

It seems a browser used javascript issue. It get different results in different browsers. Intl.DisplayNames has a input para style, which is long by default.

firefox: style=long -> 'Hong Kong SAR China' firefox: style=short -> 'Hong Kong'

chrome: style=long -> 'Hong Kong' chrome: style=short -> 'Hong Kong'

safari: style=long -> 'Hong Kong' safari: style=short -> 'Hong Kong'

gauthier-th commented 2 months ago

I can get a good result in MacOS + firefox image

It seems a browser used javascript issue. It get different results in different browsers. Intl.DisplayNames has a input para style, which is long by default.

firefox: style=long -> 'Hong Kong SAR China' firefox: style=short -> 'Hong Kong'

chrome: style=long -> 'Hong Kong' chrome: style=short -> 'Hong Kong'

safari: style=long -> 'Hong Kong' safari: style=short -> 'Hong Kong'

Good to know. Unfortunately, this means we can't really do anything about it.

theggs commented 2 months ago

yes, and can't expect the brower js engine will fix it quickly. Let me will see what I can do for it when I have time.