Skip to content

Commit e63797a

Browse files
committed
add photo credt localization
1 parent 79d9221 commit e63797a

4 files changed

Lines changed: 18 additions & 2 deletions

File tree

locale/LOCALIZATION.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,12 @@ of the file, e.g.,
6161
\olfileid[fr]{sfr}{siz}{int}
6262
```
6363

64+
If you include photos from the [OLP photo
65+
repository](https://github.com/OpenLogicProject/photos), you should
66+
translate the photo credit files in
67+
`assets/photos/<name>/<name>-credit.tex` and put those into a (new)
68+
directory `locale/fr/photocredits.
69+
6470
To prepare translations of textbooks, e.g., [_Set
6571
Theory_](https://github.com/OpenLogicProject/set-theory), put the
6672
contents of the corresponding repository in `locale/fr/courses/`. To

open-logic-locale.sty

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656

5757
\addto\extrasenglish{
5858
% execute whenever the language switches to English
59+
\Crefname{page}{p.}{pp.}
5960
\Crefname{thm}{Theorem}{Theorems}
6061
\Crefname{ex}{Example}{Examples}
6162
\Crefname{defn}{Definition}{Definitions}
@@ -91,7 +92,7 @@
9192
\href{http://creativecommons.org/licenses/by/4.0/}{CC--BY}.}
9293
\newcommand*{\oluselicensetext}
9394
{It is based on
94-
\textit{\href{\OLTlinktext}{\OLTname}}
95+
\textit{\href{\OLTlinkname}{\OLTname}}
9596
by the
9697
\href{http://openlogicproject.org/}{\OLPname},
9798
used under a

sty/open-logic-referencing.sty

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
% but not localized
2222
\IfNoValueT {#1}
2323
{\ifdefined\ollangid
24+
\PackageWarning{open-logic}{File locale/\ollangid/\olfilebase\olfilename.tex requested but not marked \ollangid}
2425
\OLUnLocalizedHook{#1}
2526
\fi}}
2627

sty/open-logic.sty

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,9 +315,17 @@
315315
\includegraphics[width=#1]{\olpath/assets/photos/#2/#2-small}}{
316316
\includegraphics[width=#1]{\olpath/assets/photos/#2/#2-large}}
317317
\caption{#3}
318+
\label{photo-#2}
318319
\IfFileExists{\olpath/assets/photos/#2/#2-credit.tex}{%
320+
\ifdefined\ollangid
321+
\IfFileExists{\olpath/locale/\ollangid/photocredits/#2-credit.tex}{
322+
\CatchFileDef{\photocredit}{\olpath/locale/\ollangid/photocredits/#2-credit.tex}{}%
323+
\addtocontents{pcr}{#3, \cpageref{photo-#2}: \photocredit\par}}{
324+
\PackageWarning{open-logic}{Photo credits \olpath/locale/\ollangid/photocredits/#2-credit.tex not found}}
325+
\else
319326
\CatchFileDef{\photocredit}{\olpath/assets/photos/#2/#2-credit.tex}{}%
320-
\addtocontents{pcr}{#3, p.~\thepage: \photocredit\par}}{}
327+
\addtocontents{pcr}{#3, \cpageref{photo-#2}: \photocredit\par}
328+
\fi}{}
321329
\end{wrapfigure}}}{}}
322330

323331
% \olasset[width]{file} - include an illustration

0 commit comments

Comments
 (0)