Localization
The CAS Web application includes a number of localized message files:
- English (US)
- Spanish
- French
- Russian
- Dutch (Netherlands)
- Swedish (Svenskt)
- Italian (Italiano)
- Urdu
- Chinese (Simplified)
- German (Deutsch)
- Japanese
- Croatian
- Czech
- Slovenian
- Polish
- Portuguese (Brazil)
- Turkish
- Farsi
- Arabic
In order to “invoke” a specific language for the UI, the /login
endpoint may be passed a locale
parameter as such:
1
https://cas.server.org/login?locale=it
Note that not all languages are complete and accurate across CAS server releases as translations are entirely dependent upon community contributions. For an accurate and complete list of localized messages, always refer to the English language bundle.
Configuration
All message bundles are marked under messages_xx.properties
files at src/main/resources
.
The default language bundle is for the
English language and is thus called messages.properties
. If there are any custom
messages that need to be presented into views,
they may also be formatted under custom_messages.properties
files.
In the event that the code is not found in the activated resource bundle, the code itself will be used verbatim.
Localization
The following settings and properties are available from the CAS configuration catalog:
cas.locale.cookie.allowed-ip-addresses-pattern=
A regular expression pattern that indicates the set of allowed IP addresses, when |
cas.locale.cookie.comment=CAS Cookie
CAS Cookie comment, describes the cookie's usage and purpose. |
cas.locale.cookie.domain=
Cookie domain. Specifies the domain within which this cookie should be presented. The form of the domain name is specified by RFC 2965. A domain name begins with a dot (.foo.com) and means that the cookie is visible to servers in a specified Domain Name System (DNS) zone (for example, www.foo.com, but not a.b.foo.com). By default, cookies are only returned to the server that sent them. |
cas.locale.cookie.http-only=true
true if this cookie contains the HttpOnly attribute. This means that the cookie should not be accessible to scripting engines, like javascript. |
cas.locale.cookie.max-age=-1
The maximum age of the cookie, specified in seconds. By default, |
cas.locale.cookie.name=
Cookie name. Constructs a cookie with a specified name and value. The name must conform to RFC 2965. That means it can contain only ASCII alphanumeric characters and cannot contain commas, semicolons, or white space or begin with a |
cas.locale.cookie.path=
Cookie path. Specifies a path for the cookie to which the client should return the cookie. The cookie is visible to all the pages in the directory you specify, and all the pages in that directory's subdirectories. A cookie's path must include the servlet that set the cookie, for example, /catalog, which makes the cookie visible to all directories on the server under /catalog. Consult RFC 2965 (available on the Internet) for more information on setting path names for cookies. |
cas.locale.cookie.pin-to-session=true
When generating cookie values, determine whether the value should be compounded and signed with the properties of the current session, such as IP address, user-agent, etc. |
cas.locale.cookie.same-site-policy=
If a cookie is only intended to be accessed in a first party context, the developer has the option to apply one of settings SameSite=None , to designate cookies for cross-site access. When the SameSite=None attribute is present, an additional Secure attribute is used so cross-site cookies can only be accessed over HTTPS connections. Accepted values are:
|
cas.locale.cookie.secure=true
True if sending this cookie should be restricted to a secure protocol, or false if the it can be sent using any protocol. |
cas.locale.default-value=en
Default locale. |
cas.locale.force-default-locale=false
When set to true, locale resolution via request parameters and such is ignored and the locale default value is always enforced. |
cas.locale.param-name=locale
Parameter name to use when switching locales. |