Skip to content

Commit

Permalink
Add missing Luri (Bakhtiari) title, flag, and RTL
Browse files Browse the repository at this point in the history
  • Loading branch information
kefir500 committed Dec 8, 2024
1 parent ec2e5b9 commit 4a4d55f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
6 changes: 5 additions & 1 deletion src/base/application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,11 @@ void Application::setLanguage(const QString &locale)
translatorQt.load(QString("qt.%1").arg(locale), path);
installTranslator(&translator);
installTranslator(&translatorQt);
setLayoutDirection(QLocale(locale).textDirection());
if (locale == "bqi") {
setLayoutDirection(Qt::RightToLeft);
} else {
setLayoutDirection(QLocale(locale).textDirection());
}
settings->setLanguage(locale);
} else {
settings->setLanguage("en");
Expand Down
12 changes: 10 additions & 2 deletions src/base/language.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,17 @@
Language::Language(const QString &path)
{
code = path.split('.').at(1);
locale = QLocale(code);
title = Utils::capitalize(locale.nativeLanguageName());
locale = (code == "bqi")
? QLocale(QLocale::NorthernLuri, QLocale::Iran)
: QLocale(code);
flag = Utils::getLocaleFlag(locale);

if (code == "bqi") {
// Provide the missing language title for Luri (Bakhtiari)
title = "بختیاری";
} else {
title = Utils::capitalize(locale.nativeLanguageName());
}
}

QString Language::getTitle() const
Expand Down

17 comments on commit 4a4d55f

@korekasnadar
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In these codes, I see two problems that must be corrected...
1- The Lori language is divided into three languages ​​or dialects... 1- Northern Luri (lrc), Luri Bakhtiari (bqi) and Southern Luri (luz)
If you want to add all three, tell me and I will send you their local names...
2- The displayed name for بختیاری language should be changed to لۊری بختیاری...

@kefir500
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. QLocale::NorthernLuri is used just as fallback locale, since Qt doesn't support bqi. Seems that there are no side effects – just this reference in the code.
  2. Fixed in 6538f6f.

@korekasnadar
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I completely understand what you mean and thank you for correcting the name of the language...

Now I have two questions...
1- Can I request to add Luri language codes to the Qt platform???
2- How can I use a new flag file to change the flag next to the language???

@kefir500
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. AFAIK, you can use Qt Bug Tracker for feature requests.
  2. Again, the non-standard flag substitutions are performed manually via code (check the ckb locale for example). Which flag do you want to use?

@korekasnadar
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1- Thanks for the advice on this matter...
2- No, ckb or the Kurdish flag has nothing to do with Lur and should not be used...

In addition to the existing flags, I want to send you a new flag that is not in the list so that you can use it; Is this possible???

@kefir500
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. I understand that. What I mean is the Kurdish flag is (currently) the only custom flag in APK Editor Studio. I was referring to it in terms of the code example.

So yes, it is possible to include a custom flag. However, isn't the Luri (Bakhtiari) mostly speak in Iran? Flags in APK Editor Studio usually represent countries, so I'm wondering which custom flag you'd like to use,

@korekasnadar
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your understanding...

Yes, most of the people of Lur are in Iran, but there is a possibility that people will confuse this language with Farsi, which is the official language of Iran...

It is good that we can use a new flag; I will decide on this matter soon and I will inform you in this part of the site...

More details: If you need to define a new flag, I will send you the file...

@kefir500
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Usually, the locale flag matches the country, so the duplication is a common practice, and not something to avoid. For example, fr-CA (Canadian French) is clearly French language. However, the corresponding flag must refer to Canada, not France. Since the most suitable country for Luri is Iran, I don't see much trouble with the aforementioned confusion (again, duplicated flags is a pretty common practice). The major thing I would like to avoid is some kind of non-official flags.

@korekasnadar
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right, but Kurds have a completely separate flag, even though they live in several countries...

So if we want to use a new flag, I don't think it will be difficult to use it or cause any problems...

@kefir500
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but currently we're using the Kurdistan Region flag which is a pretty official (though disputable) geographical feature. So I'm just trying to understand, which official (even related to region and not a country) flag do you want to use for Luri?

@korekasnadar
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's better to keep it on the Iranian flag for now and I'll decide on changing it later and we'll talk...
Is this good???

@korekasnadar
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, I sent my request to Qt and I will inform you whenever the Luri language codes are supported so that you can change Luri Bakhtiari to the exact same Luri Bakhtiari...

@kefir500
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great. Could you please also send the link to your request?

@korekasnadar
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I applied through the form and unfortunately there is no link to provide you... I did not apply for a link on GitHub...

But a few hours ago they sent a message that we received your application and that our colleagues are on leave and may apply in January...

@kefir500
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems that this is your request, isn't it?

@korekasnadar
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this is my report for Qt, but they said the problem is that the cldr project does not support Luri codes...

Thank you very much for following up on this problem with me...

@korekasnadar
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello, I translated this project completely...
Please update the translations...
@kefir500

Please sign in to comment.