Check Localization of name?

All your suggestions, requests and ideas for future development
Post Reply
GlassFish
Posts: 20
Joined: 22 Jun 2014, 14:48

Check Localization of name?

Post by GlassFish »

Hi, I would like to know how to check if the used name has Japanese characters in it.

I am using:

Code: Select all

 {norm(localize.ger.ny)+"/"}
{f.subtitle ? "Subs/" : null}   
 {norm(localize.en.ny)}{" - Part $pi"}
The problem is that several movies do not have the name in german and then default to japanese, which is quite annoying.
I want to fix that.

eg.: themoviedb
Hunter x Hunter Last Mission
It will show the Original title with the japanese characters, although the site is written in german.
However, even if there is no english title defined "en.ny" will just output the title in english.

The same with the Collection name. Is there a way to not use the japanese characters? Because I am unable to find an alternative Collection name.
Actually, I can just replace this japanese name with "collection"...

eg.:
Tiger & Bunny
The Collection itself has japanese characters in front of the name
The ger name has japanese characters in front too .


So, how can I check if the name has/is in japanese and then default to english?
OR how can I default to the japanese Alternativetitle, because that one is always in english unlike the originaltitle.

What can I do when a name/collection has Kanji? in it but there is no translated title?

Also, can I somehow take the japanese name in english words? There is often the japanese alternativename in english given but when I just use "ja.ny" then I will get the originaltitle which is in kanji.
kim
Power User
Posts: 1251
Joined: 15 May 2014, 16:17

Re: Check Localization of name?

Post by kim »

Code: Select all

{'劇場版 HUNTER×HUNTER -The LAST MISSION-'.any{it.matches(/[\u3000-\u303F]|[\u3040-\u309F]|[\u30A0-\u30FF]|[\uFF00-\uFFEF]|[\u4E00-\u9FAF]|[\u2605-\u2606]|[\u2190-\u2195]|\u203B/)} ? 'jp' : 'no jp'}

Code: Select all

{'劇場版 Tiger & Bunnyシリーズ'.any{it.matches(/[\u3000-\u303F]|[\u3040-\u309F]|[\u30A0-\u30FF]|[\uFF00-\uFFEF]|[\u4E00-\u9FAF]|[\u2605-\u2606]|[\u2190-\u2195]|\u203B/)} ? 'jp' : 'no jp'}
btw: does this do anything ?

Code: Select all

norm()
answer = no

https://gist.github.com/ryanmcgrath/982242
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Check Localization of name?

Post by rednoah »

If you are using TheMovieDB::TV with FileBot 4.9.2 then there are known issues:
viewtopic.php?t=12284

rednoah wrote: 29 Sep 2020, 05:56 Known Issues:
TheMovieDB::TV prefers the Original Name field for {n} and thus ignores the user-defined language preferences in cases where Name and Original Name are not one and the same (fixed with r8090)
:idea: Please read the FAQ and How to Request Help.
Post Reply