Commit 6c7ef4c7 authored by unknown's avatar unknown

multi-language support

parent 5fbb43d4
......@@ -3,10 +3,11 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>ubwidget</title>
<title>AnyEmbed</title>
<script src="js/jquery-1.3.2.min.js" type="text/javascript"></script>
<script src="js/jquery.disable.text.select.js" type="text/javascript"></script>
<script src="js/languages.js" type="text/javascript"></script>
<script src="js/ubw-main.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="css/ubwidget.css" />
......
var sankoreLang = {
"en":{
"embed": "Embed"
},
"ru":{
"embed": "Вставить"
},
"fr":{
"embed": "Intégrer"
}
};
......@@ -14,84 +14,101 @@
*/
function init(){
var embed;
var inputBox = $("<textarea type='text'></textarea>")
.css({
width: "350px",
height: "58px",
marginRight: "5px"
});
var embed;
var lang = "";
if(window.sankore){
try{
lang = sankore.locale().substr(0,2);
sankoreLang[lang].embed;
} catch(e){
lang = "en";
}
} else
lang = "en";
var inputBox = $("<textarea type='text'></textarea>")
.css({
width: "350px",
height: "58px",
marginRight: "5px"
});
var submit = $("<div>Embed</div>")
.css({
float: "right",
width: "auto",
height:"auto",
padding:"4px",
marginTop:"13px",
cursor:"pointer",
backgroundColor:"rgb(45,65,250)",
border:"1px solid",
borderColor:"rgb(45,65,250) rgb(25,45,230) rgb(25,45,230) rgb(45,65,250)",
textTransform:"capitalize",
fontFamily:"Arial",
fontSize:"18px",
fontWeight:"regular",
color:"white"
});
var submit = $("<div>" + sankoreLang[lang].embed + "</div>")
.css({
float: "right",
width: "auto",
height:"auto",
padding:"4px",
marginTop:"13px",
cursor:"pointer",
backgroundColor:"rgb(45,65,250)",
border:"1px solid",
borderColor:"rgb(45,65,250) rgb(25,45,230) rgb(25,45,230) rgb(45,65,250)",
textTransform:"capitalize",
fontFamily:"Arial",
fontSize:"18px",
fontWeight:"regular",
color:"white"
});
var loadWindow = $("<div></div>");
var loadWindow = $("<div></div>");
var searchWrap = $("<div></div>")
.css({
position:"absolute",
padding: "10px",
backgroundColor: "rgb(230,230,233)",
width: "425px",
height: "65px"
});
var searchWrap = $("<div></div>")
.css({
position:"absolute",
padding: "10px",
backgroundColor: "rgb(230,230,233)",
width: "460px",
height: "65px"
});
//FIT WIDGET FRAME ON LAUNCH...
if(window.sankore){
window.sankore.resize($("#ubwidget").width()-15,85);
}
//FIT WIDGET FRAME ON LAUNCH...
if(window.sankore){
window.sankore.resize($("#ubwidget").width() + 20,85);
}
searchWrap.append(inputBox)
.append(submit);
searchWrap.append(inputBox)
.append(submit);
$("#ubwidget").append(searchWrap);
$("#ubwidget").append(searchWrap);
submit.click(function(){
$("#ubwidget").append(loadWindow)
embed = inputBox.val();
searchWrap.hide();
if(/<object/.test(embed)){
loadWindow.append(embed);
loadWindow.find("embed").attr("wmode","opaque");
var loadWindow_content = loadWindow.html();
loadWindow.empty().html(loadWindow_content);
}
else {
loadWindow.append(embed);
}
submit.click(function(){
$("#ubwidget").append(loadWindow)
embed = inputBox.val();
searchWrap.hide();
if(/<object/.test(embed)){
loadWindow.append(embed);
loadWindow.find("embed").attr("wmode","opaque");
var loadWindow_content = loadWindow.html();
loadWindow.empty().html(loadWindow_content);
}
else {
loadWindow.append(embed);
}
if(window.sankore){
window.sankore.resize($(document).width(),$(document).height());
window.sankore.setPreference("embed", escape(embed));
}
if(window.sankore){
window.sankore.resize($(document).width(),$(document).height());
window.sankore.setPreference("embed", escape(embed));
}
});
});
if(window.sankore){
if(window.sankore){
if(window.sankore.preferenceKeys().length != 0){
if(window.sankore.preferenceKeys().length != 0){
var loadEmbed = unescape(window.sankore.preference("embed"));
inputBox.val(loadEmbed);
submit.trigger("click");
}
}
var loadEmbed = unescape(window.sankore.preference("embed"));
inputBox.val(loadEmbed);
submit.trigger("click");
}
}
if (window.widget) {
window.widget.onremove = function(){
loadWindow.empty();
}
}
}
\ No newline at end of file
......@@ -109,8 +109,7 @@ body{
height: 28px;
margin: 4px 5px;
border: none;
background-image: url(../images/greySquare.png);
font-weight: bold;
background-image: url(../images/greySquare2.png);
font-family: Verdana;
color: yellow;
cursor: pointer;
......
......@@ -10,6 +10,7 @@ and open the template in the editor.
<link rel="stylesheet" type="text/css" href="css/basic.css"/>
<script type="text/javascript" src="scripts/jquery-1.6.2.min.js"></script>
<script src="scripts/jquery.disable.text.select.js" type="text/javascript"></script>
<script src="scripts/languages.js" type="text/javascript"></script>
<script type="text/javascript" src="scripts/blackYellow.js"></script>
<script type="text/javascript">
......
......@@ -26,6 +26,7 @@ function init(){
var popupFlag = false
var flagForSelect = false;
var dragElement = null; //the element that must be dragging
var lang = ""; //locale language
var coords = {
left:0,
top:0
......@@ -36,7 +37,17 @@ function init(){
x:false,
width:0,
height:0
}
}
if(window.sankore){
try{
lang = sankore.locale().substr(0,2);
sankoreLang[lang].edit;
} catch(e){
lang = "en";
}
} else
lang = "en";
var opacityChanged = false;
......@@ -133,13 +144,13 @@ function init(){
if(!toggleFlag && !endFlag){
endFlag = true;
toggleButton.animate({
width:"72px"
width:"115px"
},"fast",function(){
toggleFlag = true;
if(!mode)
toggleButton.text("Edit");
toggleButton.text(sankoreLang[lang].edit);
else
toggleButton.text("Display");
toggleButton.text(sankoreLang[lang].display);
});
}
}
......@@ -182,10 +193,10 @@ function init(){
if(!addToggleStart && !addToggleEnd){
addToggleEnd = true;
addButton.animate({
width:"72px"
width:"115px"
},"fast",function(){
addToggleStart = true;
addButton.text("Add");
addButton.text(sankoreLang[lang].add);
});
}
}
......@@ -217,16 +228,16 @@ function init(){
//input fields and buttons for a popup window
var expressionDiv = $("<div id='expressionDiv' class='popupContainers'>").appendTo(popupBack);
var experssionLabel = $("<span id='experssionLabel' class='popupLabels'><b>Enter data:</b></span>").appendTo(expressionDiv);
var experssionLabel = $("<span id='experssionLabel' class='popupLabels'><b>" + sankoreLang[lang].enter_data + "</b></span>").appendTo(expressionDiv);
var expresionText = $("<input type='text' id='expresionText' class='expresionInput'/>").appendTo(expressionDiv);
var resultDiv = $("<div id='resultDiv' class='popupContainers'>").appendTo(popupBack);
var resultLabel = $("<span id='resultLabel' class='popupLabels'><b>Enter result:</b></span>").appendTo(resultDiv);
var resultLabel = $("<span id='resultLabel' class='popupLabels'><b>" + sankoreLang[lang].enter_result + "</b></span>").appendTo(resultDiv);
var resultText = $("<input type='text' id='resultText' class='expresionInput'/>").appendTo(resultDiv);
var popupButtonsDiv= $("<div id='popupButtonsDiv' class='popupContainers'>").appendTo(popupBack);
var cancelButton = $("<input type='button' id='cancelButton' class='popupButtons' value='Cancel'/>").appendTo(popupButtonsDiv);
var okButton = $("<input type='button' id='okButton' class='popupButtons' value='Ok'/>").appendTo(popupButtonsDiv);
var cancelButton = $("<input type='button' id='cancelButton' class='popupButtons' value='" + sankoreLang[lang].cancel + "'/>").appendTo(popupButtonsDiv);
var okButton = $("<input type='button' id='okButton' class='popupButtons' value='" + sankoreLang[lang].ok + "'/>").appendTo(popupButtonsDiv);
/* -------------- A WORK WITH POPUP BUTTONS AND FIELDS ---------------*/
......
var sankoreLang = {
"en":{
"edit": "Edit",
"display":"Display",
"add":"Add",
"enter_data":"Enter data:",
"enter_result":"Enter result:",
"ok":"Ok",
"cancel":"Cancel"
},
"ru":{
"edit": "Изменить",
"display":"Показать",
"add":"Добавить",
"enter_data":"Введите вопрос:",
"enter_result":"Введите ответ:",
"ok":"Ок",
"cancel":"Отмена"
},
"fr":{
"edit": "Modifier",
"display":"Afficher",
"add":"Ajouter",
"enter_data":"Entrer les données:",
"enter_result":"Entrez le résultat:",
"ok":"Ok",
"cancel":"Annuler"
}
};
......@@ -9,6 +9,7 @@ and open the template in the editor.
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="css/basic.css"/>
<script type="text/javascript" src="scripts/jquery-1.6.2.min.js"></script>
<script src="scripts/languages.js" type="text/javascript"></script>
<script type="text/javascript" src="scripts/selQuestionApp.js"></script>
<script type="text/javascript">
......
var sankoreLang = {
"en":{
"edit": "Edit",
"display":"Display",
"question":"Question",
"example_question":"This is an example of the question",
"answer":"This is an example of the answer",
"q":"Q",
"add_new_question":"Add new question ...",
"options":"Options",
"close":"Close",
"delete_question":"Delete question",
"delete_answer":"Delete answer",
"right_answer":"Right answer",
"template_question":"Enter your question here ...",
"template_answer":"Enter the answer here ...",
"add_answer":"Add answer",
"select_text":"Choose the right answer",
"options_desc":"You can choose any of these three options of displaying your answers. See a short their description.",
"radio_desc":"This option allow to choose one answer only and the answers are displayed as radio buttons.",
"checkbox_desc":"This option allow to choose several answers and the answers are displayed as checkboxes.",
"select_desc":"This option allow to chose one answer only and the answers are displayed as pull-down menu.",
"a":"A"
},
"ru":{
"edit": "Изменить",
"display":"Показать",
"question":"Вопрос",
"example_question":"Это пример вопроса",
"answer":"Это пример ответа",
"q":"В",
"add_new_question":"Добавить новый вопрос ...",
"options":"Настройки",
"close":"Закрыть",
"delete_question":"Удалить вопрос",
"delete_answer":"Удалить ответ",
"right_answer":"Правильный ответ",
"template_question":"Введите Ваш вопрос здесь ...",
"template_answer":"Введите ответ здесь ...",
"add_answer":"Добавить ответ",
"select_text":"Выберите правильный ответ",
"options_desc":"Вы можете выбрать любой из трех вариантов отображения. Смотрите их краткое описание.",
"radio_desc":"Эта опция позволяет выбрать только один вариант ответа. Ответы будут показаны как радио-кнопки.",
"checkbox_desc":"Эта опция позволяет выбрать несколько вариантов ответов. Ответы будут показаны как чекбоксы.",
"select_desc":"Эта опция позволяет выбрать только один вариант ответа. Ответы будут показаны в виде выпадающего меню.",
"a":"О"
},
"fr":{
"edit": "Modifier",
"display":"Afficher",
"question":"La question",
"example_question":"Ceci est un exemple de la question",
"answer":"Ceci est un exemple de la réponse",
"q":"Q",
"add_new_question":"Ajouter nouvelle question ...",
"options":"Les options",
"close":"Fermer",
"delete_question":"Supprimer la question",
"delete_answer":"Supprimer réponse",
"right_answer":"Bonne réponse",
"template_question":"Saisissez votre question ici ...",
"template_answer":"Entrez la réponse ici ...",
"add_answer":"Ajouter une réponse",
"select_text":"Choisissez la bonne réponse",
"options_desc":"Vous pouvez choisir n'importe lequel de ces trois options d'affichage de vos réponses. Voir un court leur description.",
"radio_desc":"Cette option permet de choisir une seule réponse et les réponses sont affichées sous forme de boutons radio.",
"checkbox_desc":"Cette option permet de choisir plusieurs réponses et les réponses sont affichées comme des cases à cocher.",
"select_desc":"Cette option permet de choisir une seule réponse et les réponses sont affichées sous forme de menu déroulant.",
"a":"R"
}
};
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -33,6 +33,17 @@ var imageEurope = "<img src='images/Cartes/EuropeOuest.bmp' usemap='#europe'/>";
var imageEurope2 = "<img src='images/Cartes/Eurasie2.bmp' usemap='#eurasie'/>";
var imageAsie2 = "<img src='images/Cartes/EuropeOuestAsie.bmp' usemap='#europe'/>";
var lang = ""; //locale language
if(window.sankore){
try{
lang = sankore.locale().substr(0,2);
sankoreLang[lang].europe;
} catch(e){
lang = "en";
}
} else
lang = "en";
// adresse du serveur
var url = "http://bapsot.dyndns.org/GeoInfo-GeoInfoServer/GeoInfoService";
......@@ -182,6 +193,25 @@ function recevoirPaysReponse(resultat, soapResponse)
// permet l'affichage de la description lors du passage de la souris
function writeText(txt)
{
switch(txt){
case "North America":
txt = sankoreLang[lang].north_america;
break;
case "Eurasia":
txt = sankoreLang[lang].eurasia;
break;
case "South America":
txt = sankoreLang[lang].south_america;
break;
case "Africa":
txt = sankoreLang[lang].africa;
break;
case "Oceania":
txt = sankoreLang[lang].oceania;
break;
default:
break;
}
document.getElementById("description").innerHTML = txt;
}
......@@ -222,7 +252,8 @@ function fondu(carte)
// permet de faire apparaître les infos du pays dans la petite fenêtre
function afficheInfoPays(pays)
{
//$("area[alt=" + pays + "]").css("z-index","9999");
$("#" + pays + " .nomPays").html(sankoreLang[lang][pays].country);
$("#" + pays + " .capitalePays").html(sankoreLang[lang].capital + ": " + sankoreLang[lang][pays].city);
document.getElementById("infoPays").innerHTML = "<div id='customCursor' class='customCursor'></div>" + document.getElementById(pays).innerHTML;
}
......
This diff is collapsed.
......@@ -115,5 +115,5 @@ function checkOptions(){
}
function alertOptions(){
alert("Now parameters will be saved\n------------------------------------------------------------\n"+document.cookie);
alert(sankoreLang[lang].show_saved + "\n------------------------------------------------------------\n"+document.cookie);
}
\ No newline at end of file
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>markItUp! Universal markup editor</title>
<link rel="stylesheet" type="text/css" href="images/style.css" />
<!-- jQuery -->
<script type="text/javascript" src="jquery.pack.js"></script>
<!-- markItUp! -->
<script type="text/javascript" src="languages.js"></script>
<script type="text/javascript" src="markitup/jquery.markitup.js"></script>
<!-- markItUp! toolbar settings -->
<script type="text/javascript" src="markitup/sets/html/set.js"></script>
<!-- markItUp! toolbar skin -->
<link rel="stylesheet" type="text/css" href="markitup/skins/markitup/style.css" />
<link rel="stylesheet" type="text/css" href="markitup/sets/html/style.css" />
</head>
<body>
<script type="text/javascript" >
$(document).ready(function() {
var lang = "";
if(window.sankore){
try{
lang = sankore.locale().substr(0,2);
sankoreLang[lang].welcome;
} catch(e){
lang = "en";
}
} else
lang = "en";
$(document).ready(function(){
$("#reset-btn").hide();
......@@ -27,7 +36,7 @@
$('iframe').width($(window).width()-24)
.height($(window).height()-46);
if(window.sankore){
var html = window.sankore.preference("iHtml", "Welcome to HTML EDITOR");
var html = window.sankore.preference("iHtml", sankoreLang[lang].welcome);
$("#markItUp").val(html);
};
......@@ -59,6 +68,7 @@
.height($(window).height()-46);
$('#markItUpFooter').width($(window).width()-30);
$("#markitUp").html(sankoreLang[lang].welcome);
});
</script>
......
var sankoreLang = {
"en":{
"enter_title": "Enter yuor title here...",
"welcome":"Welcome to HTML Editor",
"source":"Source",
"link":"Link",
"preview":"Preview",
"text_to_link":"Your text to link",
"alt_text":"Alternative text"
},
"ru":{
"enter_title": "Введите Ваш заголовок ...",
"welcome":"Добро пожаловать в HTML-редактор",
"source":"Источник",
"link":"Ссылка",
"preview":"Предпросмотр",
"text_to_link":"Текст ссылки",
"alt_text":"Альтернативный текст"
},
"fr":{
"enter_title": "Entrer le titre yuor ici ...",
"welcome":"Bienvenue à HTML Editor",
"source":"Source",
"link":"Link",
"preview":"Aperçu",
"text_to_link":"Votre texte à lier",
"alt_text":"Texte alternatif"
}
};
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment