forked from Appsilon/shiny.i18n
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.Rmd
126 lines (94 loc) · 4.8 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
---
output: html_document
params:
website_url: http://appsilon.com
logo_url: https://cdn.rawgit.com/Appsilon/website-cdn/gh-pages/logo-white.png
repo_name: shiny.i18n
repo_url: https://github.com/Appsilon/shiny.i18n/
demo_url: http://appsilon.com/demos
---
<link href="http://fonts.googleapis.com/css?family=Maven+Pro:400,700|Inconsolata" rel="stylesheet" type="text/css">
<link href='docs/style.css' rel='stylesheet' type='text/css'>
`r params$repo_name`
===========
<center>
[![Travis build status](https://travis-ci.org/Appsilon/shiny.i18n.svg?branch=master)](https://travis-ci.org/Appsilon/shiny.i18n)
[![codecov](https://codecov.io/gh/Appsilon/shiny.i18n/branch/master/graph/badge.svg)](https://codecov.io/gh/Appsilon/shiny.i18n)
</center>
<div class="subheader">Shiny applications internationalisation made easy!</div>
<div class="section level2">
Actually, you can use **shiny.i18n** as a standalone R package - shiny app is just a perfect usecase example.
Using it is very simple: just prepare your translation files in one of the supported formats, read them into your app using user-friendly **shiny.i18n** interface and surround your expressions to translate by a translator tag. Thanks to that your app will remain neat and readible.
For more informations check the **Example** section below!
</div>
<div class="section level2">
Change languages and formats easy with shiny.i18n.
<!-- #Basic tutorial article is available on [Appsilon Data Science blog](your_future_art_link). -->
<!-- Live demo link below
<p style="text-align: center; font-size: x-large;">
<a href="`r params$demo_url`">Live demo</a>
</p>
-->
</div>
Source code {.darkslide}
-----------
This library source code can be found on [Appsilon Data Science's](`r params$website_url`) Github:
<br>
[`r params$repo_url`](`r params$repo_url`)
```{r, echo = F, results='asis'}
if (params$type == "web") {
cat(paste0('<script>
document.write(\'<div class="logo"><a href="', params$website_url, '"><img alt="Appsilon Data Science" src="', params$logo_url, '"/></a></div>\')
</script>
'))
}
```
How to install?
---------------
**Note! This library is still in its infancy. Api might change in the future.**
At the moment it's possible to install this library through [devtools](https://github.com/hadley/devtools).
```
devtools::install_github("Appsilon/`r params$repo_name`")
```
To install previous version you can run:
```
devtools::install_github("Appsilon/`r params$repo_name`", ref = "0.1.0")
```
Example {.darkorange}
-------
You can find some basic examples in `/inst/examples`.
#### Translation file format
Currently **shiny.i18n** supports two formats:
- **csv** - where each translation is in separate file `translation_<LANGUAGE-CODE>.csv`. Example of `translation_pl.csv` for Polish language you may find here: `inst/examples/data/translation_pl.csv`.
- **json** - single json file `translation.json` with mandatory fields: `"languages"` with list of all language codes and `"translation"` with list of dictionaries assigning each translation to a language code. Example of such a json file for Polish language you may find here: `inst/examples/data/translation.json`.
How to contribute?
-----------------
If you want to contribute to this project please submit a regular PR, once you're done with new feature or bug fix.<br>
**Changes in documentation**
Both repository **README.md** file and an official documentation page are generated with Rmarkdown, so if there is a need to update them, please modify accordingly a **README.Rmd** file and run a **build_readme.R** script to compile it.
Troubleshooting {.darkslide}
-----------------
We used the latest versions of dependencies for this library, so please update your R environment before installation.
Future enhacements
------------------
* Format numeric data
* Support plural forms
Appsilon Data Science {.footer}
------------------
```{r, echo = F, results='asis'}
if (params$type == "web") {
cat(paste0('<script>
document.write(\'<div class="logo"><a href="', params$website_url, '"><img alt="Appsilon Data Science" src="', params$logo_url, '" /></a></div><div class="subheader"> We Provide End-to-End Data Science Solutions </div> \');
</script>
'))
}
```
Get in touch [[email protected]]([email protected])
```{r, echo = F, results='asis'}
if (params$type == "web") {
cat(paste0('<script>
document.write(\'<a href="', params$repo_url, '"><img style="position: absolute; margin: 0; top: 0; right: 0; border: 0;" src="https://camo.githubusercontent.com/38ef81f8aca64bb9a64448d0d70f1308ef5341ab/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f6461726b626c75655f3132313632312e706e67" alt="Fork me on GitHub" data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png"></a>\');
</script>
'))
}
```