-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex_v2.html
228 lines (187 loc) · 10 KB
/
index_v2.html
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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
<!DOCTYPE html>
<html>
<head>
<base href="/" />
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<link href="https://fonts.googleapis.com/css?family=Roboto+Condensed:300italic,400italic,700italic,400,300,700" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="css/flexbox.css" />
<link rel="stylesheet" href="style_v2.css" />
<title>locize demo</title>
</head>
<body style="display: none;">
<div class="container">
<div class="header">
<div class="brand">
<img src="assets/locize_white.svg" style="width: 100px; margin: 0 20px;"/>
</div>
<div class="nav">
<select translated id="languageSelect" class="minimal" onChange="handleSelectChange()">
</select>
</div>
</div>
<div class="content">
<h1 id="userHeadline">Hi {{user}} - welcome to locize.</h1>
<p style="text-align: center; font-size: 1.2em; max-width: 850px; margin: 10px auto; color: #555;">
Locize can be used to translate the content of a landing page in minutes.
</p>
<p style="text-align: center; font-size: 1.2em; max-width: 850px; margin: 10px auto 60px; color: #555;">
But it really starts to shine on larger scale – developers, content editors and translators will love it. They get the power of continuous localization – doing their job more efficient and in better quality.
</p>
<div class="row">
<div class="col col-sm-4">
<h3>First thing first:</h3>
</div>
<div class="col col-sm-8 box-white">
<h4>To get a first feeling you should change the current language using the dropdown in the upper right corner.</h4>
<p>We already translated the content to german and italian. So you might checkout the most basic feature of locize – translating content.</p>
</div>
</div>
<div class="row">
<div class="col col-sm-4">
<h3>Continuous localization starts with:</h3>
</div>
<div class="col col-sm-8 box-white">
<h4>To be able to change your texts anytime...without the need to touch your website or application.</h4>
<p style="font-style: italic;"><strong>This text might need some change?</strong></p>
<p><a id="linkToSubtitle" class="btn" target="_blank">Change it</a>
<p class="hint">After changing the content and saving it reload this page to see it live! All content got served directly via our CDN. Any change you do will be auto published (could be overridden in settings to manual publishing).</p>
<a name="editorSection"></a>
</div>
</div>
<div class="row">
<div class="col col-sm-4">
<h3>Continuous localization means also:</h3>
</div>
<div class="col col-sm-8 box-white">
<h4>No need to manually add new content to your translation project.</h4>
<p style="font-style: italic;"><strong>While all content on this page was translated already lets assume this sentence was newly added to your app.</strong></p>
<p>Check your project – as long as you did not reload it – all languages we provided show up as 100% translated. Reload your locize project now and you will see new content was added without you adding it.</p>
<p>You can directly filter your reference language to show newly added content:</p>
<p><a id="linkToMissing" class="btn" target="_blank">See it</a>
<p class="hint">The code you added to your project is able to directly submit new content to your project. No longer adding resources by hand. Your developers can focus on your application again – no time consuming extra steps to localizing it.</p>
</div>
</div>
<div class="row">
<div class="col col-sm-4">
<h3>And further:</h3>
</div>
<div class="col col-sm-8 box-white">
<h4>You should be able to add new languages without the help of your development.</h4>
<p>Open your project and click on the "Add new language" button there.</p>
<p><a id="linkToAddLanguage" class="btn" target="_blank">Open your project</a>
<p class="hint">After adding a new language reload this page and see your new locale was added to the language dropdown in the upper right corner.</p>
</div>
</div>
<div class="row">
<div class="col col-sm-4">
<h3>Continuous localization ends with:</h3>
</div>
<div class="col col-sm-8 box-white">
<h4>Localization should be simpler...then having to search text contained on your website in the locize project.</h4>
<p>You could enable direct linking from your website to the locize project by adding the querystring "locize=true" to the url. Doing so you can click any content and that will directly open in locize.</p>
<p><a id="linkToEditor" class="btn" target="_blank" onclick="enableEditor()">Enable it</a></p>
<p class="hint">Eventual you will need to allow the popup blocked by browser so we could open a locize tab connected with this window. You could turn on/off by using the button in bottom right corner.</p>
</div>
</div>
<div class="row">
<div class="col col-sm-4">
<h3>Learn more:</h3>
</div>
<div class="col col-sm-8 box-white">
<h4>You can find more information.</h4>
<p>About additional services, versioning, namespaces, caching and more in our documentation:</p>
<ul>
<li><a href="https://docs.locize.com/more/general-questions/how-is-locize-different-from-the-alternatives" target="_blank">Read our documentation</a></li>
</ul>
<p>About translation features like plurals, context:</p>
<ul>
<li><a href="https://www.i18next.com/translation-function/interpolation" target="_blank">Learn more here</a></li>
</ul>
<p>About localization in general in our blog, eg:</p>
<ul>
<li><a href="https://www.locize.com/blog/localization-fun/" target="_blank">Localization should be fun</a></li>
<li><a href="https://www.locize.com/blog/continuous-development-integration-and-localization-cd/" target="_blank">Continuous Localization</a></li>
</ul>
</div>
</div>
<div class="row">
<div class="col col-sm-4">
<h3>Now it's your time:</h3>
</div>
<div class="col col-sm-8 box-white">
<h4>Create your first project.</h4>
<p>Add a new project by clicking the "Add new project" on your dashboard:</p>
<p><a id="linkToAddProject" class="btn" target="_blank">Open your dashboard</a>
<p class="hint">After adding a new project you will get further instructions on how to instrument your code.</p>
<h3>Got any question? <a href="mailto:support@locize.com">Contact us!</a></h3>
</div>
</div>
</div>
</div>
<!-- demo script -->
<script src="https://unpkg.com/locizify@^3.0.0"></script>
<script src="shared.js"></script>
<script>
var getParameterByName = window.locizeUtils.getParameterByName;
var updateQueryStringParameter = window.locizeUtils.updateQueryStringParameter;
var appUrl = 'https://www.locize.app'; // /p/afk6scq0/v/latest/en/translation
// manual init of locizify
var backend = {
referenceLng: 'en',
apiKey: getParameterByName('api_key'),
projectId: getParameterByName('project_id'),
getLanguagesPath: `https://api.locize.app/languages/{{projectId}}?t=${new Date().getTime()}`,
allowedAddOrUpdateHosts: ["localhost", "demo.locize.app"]
}
if (getParameterByName('dev')) {
appUrl = 'https://dev.locize.app';
backend.loadPath = 'https://api-dev.locize.app/{{projectId}}/latest/{{lng}}/{{ns}}';
backend.addPath = 'https://api-dev.locize.app/missing/{{projectId}}/latest/{{lng}}/{{ns}}';
backend.getLanguagesPath = `https://api-dev.locize.app/languages/{{projectId}}?t=${new Date().getTime()}`;
}
// some dynamic content
var userHeadline = document.getElementById('userHeadline');
userHeadline.setAttribute('i18next-options', JSON.stringify({ user: getParameterByName('name')}));
var linkToSubtitle = document.getElementById('linkToSubtitle');
var urlToSubtitle = appUrl + '/p/' + getParameterByName('project_slug') + '/v/latest/' + (getParameterByName('lng') || 'en') + '/translation?search=This%20text%20might%20need%20some%20change%3F';
linkToSubtitle.setAttribute('href', urlToSubtitle);
var linkToMissing = document.getElementById('linkToMissing');
var urlToMissing = appUrl + '/p/' + getParameterByName('project_slug') + '/v/latest/en/translation?state=bymiss';
linkToMissing.setAttribute('href', urlToMissing);
var linkToAddLanguage = document.getElementById('linkToAddLanguage');
var urlToAddLanguage = appUrl + '/p/' + getParameterByName('project_slug') + '/v/latest';
linkToAddLanguage.setAttribute('href', urlToAddLanguage);
var linkToAddProject = document.getElementById('linkToAddProject');
linkToAddProject.setAttribute('href', appUrl);
var locOptions = {
debug: true,
fallbackLng: 'en',
backend: backend
};
if (getParameterByName('dev')) {
locOptions.editor = {
url: 'https://dev.locize.app',
}
}
// init locizify
window.locizify.init(locOptions);
// params not exist
// var search = window.location.search;
// var params = ['project_id', 'api_key'];
// var alertEle = document.getElementById('mainAlert');
// params.forEach(function(p) {
// if (search.indexOf(p) < 0) alertEle.style.display = 'block';
// });
function enableEditor() {
var loc = updateQueryStringParameter(window.location.href, 'locize', 'true');
window.location = loc + '#editorSection';
}
function saveMissing() {
var loc = updateQueryStringParameter(window.location.href, 'lng', 'en');
loc = updateQueryStringParameter(loc, 'saveMissing', 'true');
window.location = loc + '#section2';
}
</script>
</body>
</html>