Skip to content

Commit

Permalink
Update document.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Mar 11, 2017
1 parent ca1d1ee commit 6a9688c
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ var tran = new Translater({
http://127.0.0.1:9005/test/test.html?lang=jp
```

## 文本翻译添加
## Text

```html
<div>
Expand All @@ -56,12 +56,29 @@ http://127.0.0.1:9005/test/test.html?lang=jp
</div>
```

## 图片切换
## Image

```html
<img alt="images" src="../img/image.jpg" data-lang-cn="../img/image_cn.jpg" data-lang-jp="../img/image_jp.jpg" />
<img
alt="image"
alt-cn="图片"
alt-jp="画像"

title="image2"
title-cn="图片2"
title-jp="画像2"

src="../img/imgae.jpg"
data-lang-cn="../img/imgae_cn.jpg"
data-lang-jp="../img/imgae_jp.jpg"/>
```

## Input

```html
<input type="text" placeholder="like this?" placeholder-cn="像这样?" />
<input type="button" value="button" value-cn="按钮" value-jp="按钮日本" />
```

## getLang/setLang

Expand All @@ -73,3 +90,4 @@ http://127.0.0.1:9005/test/test.html?lang=jp
if (tran.getLang() === "default") tran.setLang('en');
</script>
```

0 comments on commit 6a9688c

Please sign in to comment.