【发布时间】:2014-01-13 06:46:53
【问题描述】:
我的主页(index.php)看起来像:
<?php start_session();
... PHP CODE ...
?>
<html>
... HTML CODE ...
<script type="text/javascript">
var bscTexts =
{
signup: {
cropPicture: 'Crop your profile picture',
},
home: {
noFavorites: 'You haven´t added any profiles as favorites'
},
general: {
errorUploading: 'Error uploading, please try again',
successfulUploading: 'Votre photo a bien été obtenue',
chooseAnotherPicture: 'Choisir une autre photo',
loadingMore: 'Loading, please wait...'
},
notificationBubbles: {
/*InterestedInYou */ 1: {
Text: '[Name] has shown interest in you',
Url: "/match/interestedinme"
},
/*Match */ 2: {
Text: 'You and [Name] are now a match',
Url: "/match/matches"
},
/*WinkSent */ 3: {
Text: 'You have received a wink from [Name]',
Url: "/home/socialstream"
},
/*LovedPicture */ 4: {
Text: '[Name] loves one of your pictures',
Url: "/home/socialstream"
}
}
};
</script>
... OTHER HTML CODE ...
</html>
我想知道是否可以用jquery或其他(dom)替换文本(字符串语句)
例如:
如果我调用警报(bscTexts.signup.cropPicture);结果是带有“裁剪您的个人资料图片”的弹出警报
我需要知道在页面加载 jquery、javascript 或其他方法后是否可以用法语翻译替换“裁剪您的个人资料图片”以获得此:
<script type="text/javascript">
var bscTexts =
{
signup: {
cropPicture: 'Redimensionnez votre photo',
}
</script>
例如,我需要更改所有字符串。
感谢您的帮助!
【问题讨论】:
标签: javascript jquery dom text