Scientific Word/WorkplaceTranslation of Identifiers to other Language

Information and discussion about Scientific Word and Scientific Workplace, two commercial WYSIWYG-like editors for Windows
omer21
Posts: 11
Joined: Wed Oct 24, 2012 3:32 pm

Translation of Identifiers to other Language

Post by omer21 »

Hi,

is it possible to translate theorem, definition, lemma, ... strings like to Turkish in SW? For example I want to change "Definition" to "Tanım". If it is possible could you help?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

omer21
Posts: 11
Joined: Wed Oct 24, 2012 3:32 pm

Translation of Identifiers to other Language

Post by omer21 »

I used babel package and I did some changes in preamble for example I replaced

Code: Select all

\newtheorem{definition}[theorem]{Definition}
with

Code: Select all

\newtheorem{definition}[theorem]{Tanım}
Here is my document code.

Code: Select all

\documentclass{article}%
\usepackage[turkish]{babel}%
\usepackage{amsmath}%
\setcounter{MaxMatrixCols}{30}%
\usepackage{amsfonts}%
\usepackage{amssymb}%
\usepackage{graphicx}

%BeginMSIPreambleData
\providecommand{\U}[1]{\protect\rule{.1in}{.1in}}
%EndMSIPreambleData
\newtheorem{theorem}{Theorem}
\newtheorem{acknowledgement}[theorem]{Acknowledgement}
\newtheorem{algorithm}[theorem]{Algorithm}
\newtheorem{axiom}[theorem]{Axiom}
\newtheorem{case}[theorem]{Case}
\newtheorem{claim}[theorem]{Claim}
\newtheorem{conclusion}[theorem]{Conclusion}
\newtheorem{condition}[theorem]{Condition}
\newtheorem{conjecture}[theorem]{Conjecture}
\newtheorem{corollary}[theorem]{Sonuç}
\newtheorem{criterion}[theorem]{Criterion}
\newtheorem{definition}[theorem]{Tanım}
\newtheorem{example}[theorem]{Örnek}
\newtheorem{exercise}[theorem]{Exercise}
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{notation}[theorem]{Notation}
\newtheorem{problem}[theorem]{Problem}
\newtheorem{proposition}[theorem]{Proposition}
\newtheorem{remark}[theorem]{Remark}
\newtheorem{solution}[theorem]{Solution}
\newtheorem{summary}[theorem]{Summary}
\newenvironment{proof}[1][Proof]{\noindent\textbf{#1.} }{\ \rule{0.5em}{0.5em}}
\begin{document}

\begin{theorem}
this is theorem

\begin{definition}
this is definition

\begin{example}
this is ex.

\begin{corollary}
dsfsdf
\end{corollary}
\end{example}
\end{definition}
\end{theorem}


\end{document}
I get the output as in the attached image which does not seem properly.
Attachments
identifiers-turkish.jpg
identifiers-turkish.jpg (17.88 KiB) Viewed 31758 times
Last edited by localghost on Sat Nov 24, 2012 1:29 pm, edited 1 time in total.
User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

Translation of Identifiers to other Language

Post by cgnieder »

Try adding \usepackage[T1]{fontenc} to your preamble.

Regards
site moderator & package author
omer21
Posts: 11
Joined: Wed Oct 24, 2012 3:32 pm

Re: Translation of Identifiers to other Language

Post by omer21 »

Thanks for your reply cgnieder
But no luck. I get same output.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Translation of Identifiers to other Language

Post by localghost »

In addition to the correct font encoding (by fontenc) you need a corresponding input encoding e.g. by selinput. Add these lines to the document preamble.

Code: Select all

\usepackage{selinput}
\SelectInputMappings{   % Semi-automatic determination
  ccedilla={ç},         % of input encoding
  odieresis={ö},        % by a list of selected glyphs
  scedilla={ş}          % see: http://partners.adobe.com/public/developer/en/opentype/glyphlist.txt
}

Thorsten
User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

Translation of Identifiers to other Language

Post by cgnieder »

Sorry, I suggested the wrong package (although »fontenc« definitely doesn't hurt). You should add

Code: Select all

\usepackage[<encoding>]{inputenc}
where <encoding> should be the suiting package option according to the input encoding of your file. For me it is utf8.

Regards

PS: or go with Thorsten's suggestion :)
site moderator & package author
omer21
Posts: 11
Joined: Wed Oct 24, 2012 3:32 pm

Translation of Identifiers to other Language

Post by omer21 »

As I know right font encoding is iso-8859-9 (latin5) for Turkish. I tried

Code: Select all

\usepackage[latin5]{inputenc}
but it does not work. Also I tried it with Thorsten's suggestion but I got the following error

Code: Select all

Package babel Warning: No hyphenation patterns were loaded for
(babel)                the language `Turkish'
(babel)                I will use the patterns loaded for \language=0 instead.


! LaTeX Error: File `selinput.sty' not found.
User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

Translation of Identifiers to other Language

Post by cgnieder »

omer21 wrote:As i know right font encoding is iso-8859-9 (latin5) for turkish.
I tried

Code: Select all

 \usepackage[latin5]{inputenc}
but it does not work.
Not the font encoding is important here (I believe) but the input encoding of your editor. You should check with which encoding your files are saved. The one of »inputenc« should match that.

Regards
site moderator & package author
omer21
Posts: 11
Joined: Wed Oct 24, 2012 3:32 pm

Translation of Identifiers to other Language

Post by omer21 »

cgnieder wrote: Not the font encoding is important here (I believe) but the input encoding of your editor. You should check with which encoding your files are saved. The one of »inputenc« should match that.

Regards
When latin5 >>inputenc<< is in the preamble, i save document with turkish character set. Similarly with utf8 inputenc i save with UT8 character set. In both cases when i preview pdf it does not seem properly.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Translation of Identifiers to other Language

Post by localghost »

omer21 wrote:[…] Also i tried it with Thorsten's suggestion but i got the following error

Code: Select all

Package babel Warning: No hyphenation patterns were loaded for
(babel)                the language `Turkish'
(babel)                I will use the patterns loaded for \language=0 instead.
This is not part of the error, just a warning. You have to activate the hyphenation patterns for your language. I can't tell you how to do that in SW.
omer21 wrote:

Code: Select all

! LaTeX Error: File `selinput.sty' not found.
Simply install the package by the package manager of SW (if there is one). It is part of the oberdiek bundle.
Post Reply