% arara: xetex

% If texosquery.cfg is correctly set up to use texosquery-jre8
% this should work in restricted mode. The texosquery.cfg
% default settings require --shell-escape

\font\nimbus="NimbusRoman-Regular" at 10pt
\font\nimbusbf="NimbusRoman-Bold" at 10pt
\font\nimbustt="NimbusMonoPS-Regular" at 10pt
\nimbus

% If \LocaleMain isn't defined, the locale will be obtained
% from the operating system.
%\def\LocaleMain{en-GB}
% \LocaleOther may be a comma-separated list of language tags
% denoting the other locales required by the document.
\def\LocaleOther{fr-BE}
% The above need to be defined before tex-locale.tex is input

\input tex-locale

This is a sample plain XeTeX document that uses 
{\nimbustt tex-locale.tex} and {\nimbustt texosquery} to obtain locale information
from the operating system.

{\nimbusbf General Information}

OS name: \LocaleOSname.
OS version: {\nimbustt \LocaleOSversion}.
OS arch: \LocaleOSarch.

PDF now: {\nimbustt \LocaleNowStamp}.
Tag: \LocaleOStag.

\ifx\LocaleMainFile\empty
\else
  File {\nimbustt \LocaleMainFile} last modified: 
  {\nimbustt \LocaleFileMod}.
\fi

Main locale: {\nimbustt \LocaleMain} ({\nimbustt \LocaleMainDialect}).

\ForEachTrackedDialect{\thisdialect}{%
  % Iterate over each tracked dialect.
  {\nimbusbf \LocaleLanguageTag{\thisdialect}}

  Dialect label: {\nimbustt \thisdialect}.
  Language name: \LocaleLanguageNativeName{\thisdialect}
  (\LocaleLanguageName{\thisdialect}).
  \LocaleIfHasRegionName{\thisdialect}%
  {%
    Region name: \LocaleRegionNativeName{\thisdialect}
    (\LocaleRegionName{\thisdialect})%
  }%
  {No region name}.
  \LocaleIfHasVariantName{\thisdialect}%
  {%
    Variant name: \LocaleVariantNativeName{\thisdialect}
    (\LocaleVariantName{\thisdialect})%
  }%
  {No variant name}.

  Full date: \LocaleFullDate{\thisdialect}. 
  Long date: \LocaleLongDate{\thisdialect}. 
  Medium date: \LocaleMediumDate{\thisdialect}. 
  Short date: \LocaleShortDate{\thisdialect}. 
  First day of week: \LocaleFirstDayIndex{\thisdialect}
   (\LocaleDayName{\thisdialect}{\LocaleFirstDayIndex{\thisdialect}}
   / \LocaleShortDayName{\thisdialect}{\LocaleFirstDayIndex{\thisdialect}}).

  Current month: \LocaleMonthName{\thisdialect}{\month} /
   \LocaleShortMonthName{\thisdialect}{\month}.

  Standalone (display form) first day of week:
   \LocaleStandaloneDayName{\thisdialect}{\LocaleFirstDayIndex{\thisdialect}}
   / \LocaleStandaloneShortDayName{\thisdialect}{\LocaleFirstDayIndex{\thisdialect}}.

  Standalone (display form) current month:
   \LocaleStandaloneMonthName{\thisdialect}{\month} /
   \LocaleStandaloneShortMonthName{\thisdialect}{\month}.

  Full time: \LocaleFullTime{\thisdialect}. 
  Long time: \LocaleLongTime{\thisdialect}. 
  Medium time: \LocaleMediumTime{\thisdialect}. 
  Short time: \LocaleShortTime{\thisdialect}. 

  Numeric: \LocaleNumericGroupSep{\thisdialect} (group sep)
  \LocaleNumericDecimalSep{\thisdialect} (decimal sep)
  \LocaleNumericMonetarySep{\thisdialect} (monetary sep)
  \LocaleNumericExponent{\thisdialect} (exponent symbol).
  \LocaleNumericPercent{\thisdialect} (percent symbol).
  \LocaleNumericPermill{\thisdialect} (permill symbol).
  \LocaleIfNumericUsesGroup{\thisdialect}{Uses}{Doesn't use}
  numeric group separator.

  Currency label: 
  \LocaleCurrencyLabel{\thisdialect}
  (\LocaleCurrencyRegionalLabel{\thisdialect}).

  Currency symbol: 
  \LocaleCurrencySymbol{\thisdialect}
  (\LocaleCurrencyTeXSymbol{\thisdialect}).

}

\bye
