6 #ifndef C_UTILS_LANGSELECT_H 7 #define C_UTILS_LANGSELECT_H 9 #include <Cutelyst/Plugins/Utils/langselect_export.h> 10 #include <Cutelyst/plugin.h> 18 class LangSelectPrivate;
348 class CUTELYST_PLUGIN_UTILS_LANGSELECT_EXPORT LangSelect
352 Q_DECLARE_PRIVATE(LangSelect)
353 Q_DISABLE_COPY(LangSelect)
358 enum Source : quint8 {
415 void setSupportedLocales(
const QStringList &locales);
421 void addSupportedLocale(
const QLocale &locale);
428 void addSupportedLocale(
const QString &locale);
456 void setLocalesFromDir(
const QString &path,
458 const QString &prefix = QStringLiteral(
"."),
459 const QString &suffix = QStringLiteral(
".qm"));
485 void setLocalesFromDirs(
const QString &path,
const QString &name);
497 void setQueryKey(
const QString &key);
502 void setSessionKey(
const QString &key);
526 void setFallbackLocale(
const QLocale &fallback);
533 void setDetectFromHeader(
bool enabled);
538 void setLanguageCodeStashKey(
const QString &key = QStringLiteral(
"c_langselect_lang"));
544 void setLanguageDirStashKey(
const QString &key = QStringLiteral(
"c_langselect_dir"));
591 static bool fromSession(Context *c,
const QString &key = {});
610 static bool fromCookie(Context *c,
const QByteArray &name = {});
629 fromSubDomain(Context *c,
647 static bool fromDomain(Context *c,
665 static bool fromPath(Context *c,
const QString &locale);
674 bool setup(Application *app)
override;
677 const std::unique_ptr<LangSelectPrivate> d_ptr;
682 #endif // C_UTILS_LANGSELECT_H
The Cutelyst namespace holds all public Cutelyst API.
Detect and select locale based on different input parameters.
The Cutelyst application.
Plugin providing methods for session management.