19 #ifndef C_UTILS_LANGSELECT_H 20 #define C_UTILS_LANGSELECT_H 22 #include <Cutelyst/cutelyst_global.h> 23 #include <Cutelyst/plugin.h> 48 class LangSelectPrivate;
363 void setSupportedLocales(
const QVector<QLocale> &locales);
371 void setSupportedLocales(
const QStringList &locales);
377 void addSupportedLocale(
const QLocale &locale);
384 void addSupportedLocale(
const QString &locale);
408 void setLocalesFromDir(
const QString &path,
const QString &name,
const QString &prefix = QStringLiteral(
"."),
const QString &suffix = QStringLiteral(
".qm"));
431 void setLocalesFromDirs(
const QString &path,
const QString &name);
437 QVector<QLocale> supportedLocales()
const;
442 void setQueryKey(
const QString &key);
447 void setSessionKey(
const QString &key);
452 void setCookieName(
const QString &name);
471 void setFallbackLocale(
const QLocale &fallback);
478 void setDetectFromHeader(
bool enabled);
483 void setLanguageCodeStashKey(
const QString &key = QStringLiteral(
"c_langselect_lang"));
489 void setLanguageDirStashKey(
const QString &key = QStringLiteral(
"c_langselect_dir"));
495 static QVector<QLocale> getSupportedLocales();
514 static bool fromUrlQuery(
Context *c,
const QString &key = QString());
531 static bool fromSession(
Context *c,
const QString &key = QString());
548 static bool fromCookie(
Context *c,
const QString &name = QString());
594 static bool fromPath(
Context *c,
const QString &locale);
606 LangSelectPrivate *
const d_ptr;
611 #endif // C_UTILS_LANGSELECT_H
The Cutelyst namespace holds all public Cutelyst API.
Language selection plugin.
The Cutelyst Application.