From 3ebec47ec1910a7135f38c5f31b996882af238e4 Mon Sep 17 00:00:00 2001
From: Karl Berry <karl@freefriends.org>
Date: Thu, 31 Jul 2008 00:32:53 +0000
Subject: polyglossia update (30jul08)

git-svn-id: svn://tug.org/texlive/trunk@9918 c570f23f-e606-0410-a88d-b1316a301751
---
 .../tex/xelatex/polyglossia/polyglossia.sty        | 23 +++++++++++++++-------
 1 file changed, 16 insertions(+), 7 deletions(-)

(limited to 'Master/texmf-dist/tex/xelatex/polyglossia/polyglossia.sty')

diff --git a/Master/texmf-dist/tex/xelatex/polyglossia/polyglossia.sty b/Master/texmf-dist/tex/xelatex/polyglossia/polyglossia.sty
index 1d3abc4c0aa..f2d3f762faa 100644
--- a/Master/texmf-dist/tex/xelatex/polyglossia/polyglossia.sty
+++ b/Master/texmf-dist/tex/xelatex/polyglossia/polyglossia.sty
@@ -1,5 +1,5 @@
 \NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{polyglossia}[2008/07/11 v1.0 
+\ProvidesPackage{polyglossia}[2008/07/26 v1.0.1 
 	Babel replacement for XeLaTeX]
 \RequirePackage{etoolbox} % TEMPORARY? but so convenient!
 \RequirePackage{fontspec} %which itself depends on xkeyval
@@ -13,7 +13,8 @@
    \xpg@warning{No hyphenation patterns were loaded for `#1'\MessageBreak
          I will use the patterns loaded for \string\language=0\MessageBreak instead}}
 \providecommand*{\xpg@nolang}[1]{%
-   \xpg@warning{Couldn't find file gloss-#1.ldf!}}%
+   \xpg@warning{File gloss-#1.ldf does not exist!^^J
+   I will nevertheless try to use hyphenation patterns for #1.}}%
       %TODO try at least to load the hyphenation patterns for #1.
 \def\xpg@ill@value#1#2{%
   \xpg@warning{Illegal value (#1) for #2}}
@@ -126,7 +127,7 @@
     \selectbackgroundlanguage{#2}}%
    }%
    %ELSE
-   {\xpg@nolang{#2}}}%
+   {\xpg@nolang{#2}\hyphenrules{#2}}}%
 
 \let\setmainlanguage=\setdefaultlanguage
 
@@ -191,7 +192,7 @@
      {\PackageWarning{polyglossia}{gloss-#2.ldf is already loaded!}}%
    }%
    %ELSE  
-   {\xpg@nolang{#2}}%
+   {\xpg@nolang{#2}\hyphenrules{#2}}%
    %TODO ? \expandafter\ifx\csname l@#2\endcsname\@undefined
    %\xpg@nopatterns{#2}\expandafter\adddialect\csname l@#2\endcsname 0%
    %\else\expandafter\expandafter\protect\language=\csname l@#2\endcsname\fi%
@@ -217,7 +218,7 @@
    {\let\foreignlanguage\@undefined}
 
 \newcommand{\foreignlanguage}[3][]{%
-   \ifcsundef{#2@loaded}{\xpg@nolang{#2}}{%
+   \ifcsundef{#2@loaded}{\xpg@nolang{#2}\hyphenrules{#2}}{%
      {\def\languagename{#2}%
       \setkeys{#2}{#1}%
       \xpg@csifdef@warn{#2@font}%
@@ -233,7 +234,7 @@
    {\let\selectlanguage\@undefined}
 
 \newcommand{\selectlanguage}[2][]{%
-   \ifcsundef{#2@loaded}{\xpg@nolang{#2}}{%
+   \ifcsundef{#2@loaded}{\xpg@nolang{#2}\hyphenrules{#2}}{%
       \def\xpg@pop@language{%
          \xpg@set@language{\languagename}%
          \let\emp@langname\@undefined}%
@@ -282,7 +283,15 @@
    }{}
 
 \newcommand{\setlocalhyphenmins}[3]{%
-   \providehyphenmins{#1}{#2#3}}
+   \expandafter\ifx\csname l@#1\endcsname\relax%
+     \xpg@warning{\string\setlocalhyphenmin useless for unknown language #1}%
+   \else
+      \expandafter\ifx\csname l@#1\endcsname\l@nohyphenation%
+        \xpg@warning{\string\setlocalhyphenmin useless for unhyphenated language #1}%
+      \else%
+      \providehyphenmins{#1}{#2#3}%
+      \fi%
+   \fi}
 
 \def\use@localhyphenmins#1{%
    \ifcsundef{#1hyphenmins}{}%
-- 
cgit v1.2.3

