-
-
Notifications
You must be signed in to change notification settings - Fork 861
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
25 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -407,7 +407,7 @@ <h1 class="search-results-title">No results matching "<span class='search-query' | |
<script> | ||
var gitbook = gitbook || []; | ||
gitbook.push(function() { | ||
gitbook.page.hasChanged({"page":{"title":"API References","level":"1.11","depth":1,"previous":{"title":"Dynamic Locale","level":"1.10","depth":1,"path":"dynamic.md","ref":"dynamic.md","articles":[]},"dir":"ltr"},"config":{"plugins":["edit-link","github","[email protected]"],"root":"./","styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"github":{"url":"https://github.com/kazupon/vue-i18n/"},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"fontsettings":{"theme":"white","family":"sans","size":2},"highlight":{},"advanced-emoji":{"embedEmojis":false},"sharing":{"facebook":false,"twitter":false,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"edit-link":{"label":"Edit This Page","base":"https://github.com/kazupon/vue-i18n/tree/dev/gitbook"},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"links":{"sharing":{"facebook":false,"twitter":false}},"gitbook":"3.x.x"},"file":{"path":"api.md","mtime":"2016-09-15T10:27:17.000Z","type":"markdown"},"gitbook":{"version":"3.2.0","time":"2016-09-15T10:27:52.344Z"},"basePath":".","book":{"language":""}}); | ||
gitbook.page.hasChanged({"page":{"title":"API References","level":"1.11","depth":1,"previous":{"title":"Dynamic Locale","level":"1.10","depth":1,"path":"dynamic.md","ref":"dynamic.md","articles":[]},"dir":"ltr"},"config":{"plugins":["edit-link","github","[email protected]"],"root":"./","styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"github":{"url":"https://github.com/kazupon/vue-i18n/"},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"fontsettings":{"theme":"white","family":"sans","size":2},"highlight":{},"advanced-emoji":{"embedEmojis":false},"sharing":{"facebook":false,"twitter":false,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"edit-link":{"label":"Edit This Page","base":"https://github.com/kazupon/vue-i18n/tree/dev/gitbook"},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"links":{"sharing":{"facebook":false,"twitter":false}},"gitbook":"3.x.x"},"file":{"path":"api.md","mtime":"2016-09-15T10:27:17.000Z","type":"markdown"},"gitbook":{"version":"3.2.0","time":"2016-09-20T15:53:57.346Z"},"basePath":".","book":{"language":""}}); | ||
}); | ||
</script> | ||
</div> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -284,12 +284,14 @@ <h1> | |
<h1 id="component-locale">Component locale</h1><p>You can translate component based.</p><p>The below locale setting example:</p><pre><code class="lang-javascript"><span class="hljs-keyword">var</span> locales = { | ||
en: { | ||
message: { | ||
hello: <span class="hljs-string">'hello world'</span> | ||
hello: <span class="hljs-string">'hello world'</span>, | ||
greeting: <span class="hljs-string">'good morning'</span> | ||
} | ||
}, | ||
ja: { | ||
message: { | ||
hello: <span class="hljs-string">'こんにちは、世界'</span> | ||
hello: <span class="hljs-string">'こんにちは、世界'</span>, | ||
greeting: <span class="hljs-string">'おはようございます'</span> | ||
} | ||
} | ||
} | ||
|
@@ -300,26 +302,26 @@ <h1 id="component-locale">Component locale</h1><p>You can translate component ba | |
}) | ||
|
||
<span class="hljs-keyword">new</span> Vue({ | ||
el: <span class="hljs-string">'#app'</span>, | ||
el: <span class="hljs-string">'body'</span>, | ||
components: { | ||
component1: { | ||
template: <span class="hljs-string">'<p>component1 local: {{ $t("hello") }}</p>'</span> | ||
+ <span class="hljs-string">'<p>component1 global: {{ $t("message.hello") }}</p>'</span>, | ||
template: <span class="hljs-string">'<p>orverride message.hello locale in component1: {{ $t("message.hello") }}</p>'</span> | ||
+ <span class="hljs-string">'<p>global message.greeting locale in component1: {{ $t("message.greeting") }}</p>'</span>, | ||
locales: { | ||
en: { hello: <span class="hljs-string">'hello component1'</span> }, | ||
ja: { hello: <span class="hljs-string">'こんにちは、component1'</span> } | ||
en: { message: { hello: <span class="hljs-string">'hello component1'</span> } }, | ||
ja: { message: { hello: <span class="hljs-string">'こんにちは、component1'</span> } } | ||
} | ||
} | ||
} | ||
})</code></pre> | ||
<p>Template the following:</p><pre><code class="lang-html"><span class="hljs-tag"><<span class="hljs-name">div</span> <span class="hljs-attr">id</span>=<span class="hljs-string">"app"</span>></span> | ||
<span class="hljs-tag"><<span class="hljs-name">p</span>></span>{{ $t('message.hello') }}<span class="hljs-tag"></<span class="hljs-name">p</span>></span> | ||
<span class="hljs-tag"><<span class="hljs-name">p</span>></span>global message.hello locale: {{ $t('message.hello') }}<span class="hljs-tag"></<span class="hljs-name">p</span>></span> | ||
<span class="hljs-tag"><<span class="hljs-name">component1</span>></span><span class="hljs-tag"></<span class="hljs-name">component1</span>></span> | ||
<span class="hljs-tag"></<span class="hljs-name">div</span>></span></code></pre> | ||
<p>Output the following:</p><pre><code class="lang-html"><span class="hljs-tag"><<span class="hljs-name">div</span> <span class="hljs-attr">id</span>=<span class="hljs-string">"app"</span>></span> | ||
<span class="hljs-tag"><<span class="hljs-name">p</span>></span>こんにちは、世界<span class="hljs-tag"></<span class="hljs-name">p</span>></span> | ||
<span class="hljs-tag"><<span class="hljs-name">p</span>></span>component1 local: こんにちは、component1<span class="hljs-tag"></<span class="hljs-name">p</span>></span> | ||
<span class="hljs-tag"><<span class="hljs-name">p</span>></span>component1 global: こんにちは、世界<span class="hljs-tag"></<span class="hljs-name">p</span>></span> | ||
<span class="hljs-tag"><<span class="hljs-name">p</span>></span>global message.hello locale: こんにちは、世界<span class="hljs-tag"></<span class="hljs-name">p</span>></span> | ||
<span class="hljs-tag"><<span class="hljs-name">p</span>></span>orverride message.hello locale in component1: こんにちは、component1<span class="hljs-tag"></<span class="hljs-name">p</span>></span> | ||
<span class="hljs-tag"><<span class="hljs-name">p</span>></span>global message.greeting locale in component1: おはようございます<span class="hljs-tag"></<span class="hljs-name">p</span>></span> | ||
<span class="hljs-tag"></<span class="hljs-name">div</span>></span></code></pre> | ||
<blockquote><p><img align="absmiddle" alt=":pencil:" class="emoji" src="gitbook/gitbook-plugin-advanced-emoji/emojis/pencil.png" title=":pencil:"> If you set the locale of same keypath as global locale (<code>Vue.locale()</code>), in its component, <code>$t</code> is translate with component locale.</p></blockquote> | ||
|
||
|
@@ -364,7 +366,7 @@ <h1 class="search-results-title">No results matching "<span class='search-query' | |
<script> | ||
var gitbook = gitbook || []; | ||
gitbook.push(function() { | ||
gitbook.page.hasChanged({"page":{"title":"Component Locale","level":"1.9","depth":1,"next":{"title":"Dynamic Locale","level":"1.10","depth":1,"path":"dynamic.md","ref":"dynamic.md","articles":[]},"previous":{"title":"Fallback Translation","level":"1.8","depth":1,"path":"fallback.md","ref":"fallback.md","articles":[]},"dir":"ltr"},"config":{"plugins":["edit-link","github","[email protected]"],"root":"./","styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"github":{"url":"https://github.com/kazupon/vue-i18n/"},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"fontsettings":{"theme":"white","family":"sans","size":2},"highlight":{},"advanced-emoji":{"embedEmojis":false},"sharing":{"facebook":false,"twitter":false,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"edit-link":{"label":"Edit This Page","base":"https://github.com/kazupon/vue-i18n/tree/dev/gitbook"},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"links":{"sharing":{"facebook":false,"twitter":false}},"gitbook":"3.x.x"},"file":{"path":"component.md","mtime":"2016-08-29T10:50:09.000Z","type":"markdown"},"gitbook":{"version":"3.2.0","time":"2016-09-15T10:27:52.344Z"},"basePath":".","book":{"language":""}}); | ||
gitbook.page.hasChanged({"page":{"title":"Component Locale","level":"1.9","depth":1,"next":{"title":"Dynamic Locale","level":"1.10","depth":1,"path":"dynamic.md","ref":"dynamic.md","articles":[]},"previous":{"title":"Fallback Translation","level":"1.8","depth":1,"path":"fallback.md","ref":"fallback.md","articles":[]},"dir":"ltr"},"config":{"plugins":["edit-link","github","[email protected]"],"root":"./","styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"github":{"url":"https://github.com/kazupon/vue-i18n/"},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"fontsettings":{"theme":"white","family":"sans","size":2},"highlight":{},"advanced-emoji":{"embedEmojis":false},"sharing":{"facebook":false,"twitter":false,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"edit-link":{"label":"Edit This Page","base":"https://github.com/kazupon/vue-i18n/tree/dev/gitbook"},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"links":{"sharing":{"facebook":false,"twitter":false}},"gitbook":"3.x.x"},"file":{"path":"component.md","mtime":"2016-09-20T15:53:39.000Z","type":"markdown"},"gitbook":{"version":"3.2.0","time":"2016-09-20T15:53:57.346Z"},"basePath":".","book":{"language":""}}); | ||
}); | ||
</script> | ||
</div> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -354,7 +354,7 @@ <h1 class="search-results-title">No results matching "<span class='search-query' | |
<script> | ||
var gitbook = gitbook || []; | ||
gitbook.push(function() { | ||
gitbook.page.hasChanged({"page":{"title":"Dynamic Locale","level":"1.10","depth":1,"next":{"title":"API References","level":"1.11","depth":1,"path":"api.md","ref":"api.md","articles":[]},"previous":{"title":"Component Locale","level":"1.9","depth":1,"path":"component.md","ref":"component.md","articles":[]},"dir":"ltr"},"config":{"plugins":["edit-link","github","[email protected]"],"root":"./","styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"github":{"url":"https://github.com/kazupon/vue-i18n/"},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"fontsettings":{"theme":"white","family":"sans","size":2},"highlight":{},"advanced-emoji":{"embedEmojis":false},"sharing":{"facebook":false,"twitter":false,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"edit-link":{"label":"Edit This Page","base":"https://github.com/kazupon/vue-i18n/tree/dev/gitbook"},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"links":{"sharing":{"facebook":false,"twitter":false}},"gitbook":"3.x.x"},"file":{"path":"dynamic.md","mtime":"2016-08-26T07:31:42.000Z","type":"markdown"},"gitbook":{"version":"3.2.0","time":"2016-09-15T10:27:52.344Z"},"basePath":".","book":{"language":""}}); | ||
gitbook.page.hasChanged({"page":{"title":"Dynamic Locale","level":"1.10","depth":1,"next":{"title":"API References","level":"1.11","depth":1,"path":"api.md","ref":"api.md","articles":[]},"previous":{"title":"Component Locale","level":"1.9","depth":1,"path":"component.md","ref":"component.md","articles":[]},"dir":"ltr"},"config":{"plugins":["edit-link","github","[email protected]"],"root":"./","styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"github":{"url":"https://github.com/kazupon/vue-i18n/"},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"fontsettings":{"theme":"white","family":"sans","size":2},"highlight":{},"advanced-emoji":{"embedEmojis":false},"sharing":{"facebook":false,"twitter":false,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"edit-link":{"label":"Edit This Page","base":"https://github.com/kazupon/vue-i18n/tree/dev/gitbook"},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"links":{"sharing":{"facebook":false,"twitter":false}},"gitbook":"3.x.x"},"file":{"path":"dynamic.md","mtime":"2016-08-26T07:31:42.000Z","type":"markdown"},"gitbook":{"version":"3.2.0","time":"2016-09-20T15:53:57.346Z"},"basePath":".","book":{"language":""}}); | ||
}); | ||
</script> | ||
</div> | ||
|
Oops, something went wrong.