Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move docs for gh-pages branch into master #559

Merged
merged 1 commit into from
Mar 11, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions docs/CNAME
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
www.mojito.global
4 changes: 4 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Mojito Github pages
====

Install `jekyll` with `sudo gem install jekyll` and run the site locally `jekyll serve`
23 changes: 23 additions & 0 deletions docs/_config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Welcome to Jekyll!
#
# This config file is meant for settings that affect your whole blog, values
# which you are expected to set up once and rarely need to edit after that.
# For technical reasons, this file is *NOT* reloaded automatically when you use
# 'jekyll serve'. If you change this file, please restart the server process.

# Site settings
title: mojito
email: mojito-global@googlegroups.com
description: > # this means to ignore newlines until "baseurl:"
An open sourced automation platform that enables continuous localization for software development
baseurl: "" # the subpath of your site, e.g. /blog
url: "https://www.mojito.global/" # the base hostname & protocol for your site
mojito_green: <span><font color="green">mojito</font><span>
github_username: mojito
# Build settings
markdown: kramdown
exclude: ["node_modules/", "webapp/"]
collections:
docs:
output: true
google_analytics: UA-83813115-1
29 changes: 29 additions & 0 deletions docs/_data/sections.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
- class: "section-1"
type: "vertical"
title: "Continuous Localization"
description: "
Be agile. Continuously develop and localize your application real-time.<br>
New strings in the code flow into <font color=\"green\">mojito</font>, get translated, then flow back into the code. All automated!<br>
<small><i><font color=\"green\">Mojito</font> supports Android, iOS, PO, Java, Windows Resource files and XLIFF files using <a href=\"http://www.opentag.com/okapi/wiki/index.php\">Okapi Framework</a>.</i></small>"
screenshotContent: "<img src=\"images/screenshot-cl.png\" class=\"screenshot-cl\">"

- class: "section-2"
type: "vertical"
title: "Translation Searcher & Editor"
description: "
Translate and review online.<br>
Translate with confidence. <font color=\"green\">mojito</font> rejects translations with potential errors.<br>
Search specific strings across multiple repositories and languages.<br>
"
screenshotContent: "<img src=\"images/screenshot-workbench.png\" class=\"screenshot-workbench\">"

- class: "section-3"
title: "Happy localization with <font color=\"green\">mojito</font>'s powerful features..."
description: "<ul class=\"feature-list\">
<li class=\"feature-check\">Recycle and leverage existing translations.</li>
<li class=\"feature-check\">Simple UI to manage translation packages for offline translations and reviews.</li>
<li class=\"feature-check\">Powerful command line to manage TM, repositories and users.</li>
<li class=\"feature-check\">Straight-forward integration with CI pipleline such as Jenkins etc.</li>
<li class=\"feature-check\">Create and Restore TM backup.</li>
</ul><br><br>"
screenshotContent: ""
73 changes: 73 additions & 0 deletions docs/_docs/guides/001-getting-started.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
---
layout: doc
title: Getting Started
categories: guides
permalink: /docs/guides/getting-started/
---

For this guide, we use [Brew](http://brew.sh/) to install {{ site.mojito_green }} Webapp and CLI (`Java 1.8` is required).

### Setup and install

brew tap box/mojito
brew install mojito-cli
brew install mojito-webapp

### Start the Webapp

mojito-webapp

This starts the server on [http://localhost:8080](http://localhost:8080). You can log in with `admin/ChangeMe`.

![start webapp](./images/start-webapp.gif)

### Create a demo repository

mojito demo-create -n Demo1

It creates a new repository called `Demo1` in the server with some translations. A resource bundle `demo.properties` is copied on the local directory `Demo1`.

![create demo repository](./images/create-demo.gif)

### Generate the localized files

cd Demo1
mojito pull -r Demo1

It goes into `Demo1` directory and generates the localized files. You can see the generated file with `cat demo_fr-FR.properties`.

![create demo repository](./images/generate-localized.gif)

### Add a new string

printf "\nFOR_DEMO=Add a string for the demo" >> demo.properties
mojito push -r Demo1

It adds a new string with ID `FOR_DEMO` and English value `Add a string for the demo` in the resource bundle and sends the modified bundle to the server.

![add new string](./images/add-string.gif)

### Translate

Check in the Workbench that the string was added and is untranslated. Try adding a translation.

![translate](./images/translate.gif)

### Generate new localized files

mojito pull -r Demo1

Finally, this generates the updated localized files with the new translation.

![update localized filwa](./images/update-localized.gif)

### What's next?

We have covered the main commands of {{ site.mojito_green }} using a demo project that was created with `demo-create` command.
The next step is to do the setup for a real application.

First, you want to look at how to create a repository in more details with the [repo-create command]({{ site.url }}/docs/guides/creating-repository/).
We recommend to use one repository by application localized: `IOS`, `Android`, `Webapp`, etc.

If your application already has localized files, checkout the [import command]({{ site.url }}/docs/guides/import-localized-files/).
This command allows you to import your previous translation.
182 changes: 182 additions & 0 deletions docs/_docs/guides/002-install.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,182 @@
---
layout: doc
title: "Installation and Setup"
categories: guides
permalink: /docs/guides/install/
---

## Installation

### Using Brew

Install [Brew](http://brew.sh/) if needed and run following commands:

```bash
brew tap box/mojito
brew install mojito-cli
brew install mojito-webapp
```

Run the Webapp with:

mojito-webapp

Run the CLI with:

mojito

Default configuration location:

usr/local/etc/mojito/cli/application.properties
usr/local/etc/mojito/webapp/application.properties

### Using Executable Jars

`Java 1.8` is required. Executable Jars can be downloaded in the [release section](https://github.com/box/mojito/releases/).

Run the Webapp with:

```bash
java -jar mojito-webapp-*.jar
```
Run the CLI with:

```bash
java -jar mojito-cli-*.jar
```

As {{ site.mojito_green }} is based on Spring Boot, it can be [configured](http://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#boot-features-external-config) in many ways.

One simple solution is to add an `application.properties` next to the `jar`. To use a different location use `--spring.config.location=/path/to/your/application.properties`.

### CLI install script

The server provides an entry point to fetch a `bash` script that downloads the latest CLI from the server and create a bash
wrapper to easily run the CLI.

It can be called with a one liner to make the bash command available rigth away in the current console. Replace
`http://localhost:8080` with the actual URL if needed.

```bash
# bash 4:
source <(curl -L -N -s http://localhost:8080/cli/install.sh)

# bash 3 (mac):
source /dev/stdin <<< "$(curl -L -N -s http://localhost:8080/cli/install.sh)"

# Optional: specify the install directory:
source <(curl -L -N -s http://localhost:8080/cli/install.sh?installDirectory=mydirectory)
```

After that in the current console, `mojito` is available
```bash
mojito -v
```

If the server is running behind a load balancer, use the following setting to make sure the links in the bash script
use the load balancer URL:

```properties
server.use-forward-headers=true
```

## Setup

The default setup comes with `HSQL` in-memory database, database authentication and runs on port `8080`.
For production, `MySQL` should be setup. It is also possible to use [LDAP](/docs/guides/ldap-authentication) for authentication.

On the first Webapp startup, a user: `admin/ChangeMe` is created. This can be customized with configuration, see [Manage Users]({{ site.url }}/docs/guides/manage-users/#bootstraping).

### Server port

The port can be changed with the `server.port` property.

### MySQL

[Install MySQL 5.7](http://dev.mysql.com/doc/refman/5.7/en/installing.html) and then create a database for {{ site.mojito_green }}
(with Brew: `brew install mysql@5.7`).

Connect to MySQL DB as root user

```sql
mysql -u root
```

Create user `${DB_USERNAME}` with `${DB_PASSWORD}`

```sql
mysql> CREATE USER '${DB_USERNAME}'@'localhost' IDENTIFIED BY '${DB_PASSWORD}';
```

Create database `${DB_NAME}` and give `${DB_USERNAME}` full access to the database

```sql
mysql> CREATE DATABASE IF NOT EXISTS ${DB_NAME} CHARACTER SET 'utf8mb4' COLLATE 'utf8mb4_bin';
mysql> GRANT ALL ON ${DB_NAME}.* TO '${DB_USERNAME}'@'localhost' IDENTIFIED BY '${DB_PASSWORD}';
mysql> FLUSH PRIVILEGES;
```

Configure {{ site.mojito_green }} to use MySQL. When using MySQL, Flyway must be turned on.

```properties
flyway.enabled=true
l10n.flyway.clean=false
spring.jpa.database=MYSQL
spring.jpa.database-platform=org.hibernate.dialect.MySQLDialect
spring.jpa.hibernate.ddl-auto=none
spring.datasource.url=jdbc:mysql://localhost:3306/${DB_NAME}?characterEncoding=UTF-8&useUnicode=true
spring.datasource.username=${DB_USERNAME}
spring.datasource.password=${DB_PASSWORD}
spring.datasource.driverClassName=com.mysql.jdbc.Driver
spring.datasource.testOnBorrow=true
spring.datasource.validationQuery=SELECT 1

l10n.org.quartz.jobStore.useProperties=true
l10n.org.quartz.scheduler.instanceId=AUTO
l10n.org.quartz.jobStore.isClustered=true
l10n.org.quartz.threadPool.threadCount=10
l10n.org.quartz.jobStore.class=org.quartz.impl.jdbcjobstore.JobStoreTX
l10n.org.quartz.jobStore.driverDelegateClass=org.quartz.impl.jdbcjobstore.StdJDBCDelegate
l10n.org.quartz.jobStore.dataSource=myDS
l10n.org.quartz.dataSource.myDS.driver=com.mysql.jdbc.Driver
l10n.org.quartz.dataSource.myDS.URL=jdbc:mysql://localhost:3306/${DB_NAME}?characterEncoding=UTF-8&useUnicode=true
l10n.org.quartz.dataSource.myDS.user=${DB_USERNAME}
l10n.org.quartz.dataSource.myDS.password=${DB_PASSWORD}
l10n.org.quartz.dataSource.myDS.maxConnections=12
l10n.org.quartz.dataSource.myDS.validationQuery=select 1
```

Note that `utf8mb4` setup has been tested on MySQL `5.7`. The server will probably needs some configuration too, for
example by editing `my.cnf` (if installed with brew: `/usr/local/etc/my.cnf`) with something like:

```properties
[client]
default-character-set = utf8mb4

[mysqld]
character-set-server = utf8mb4
```

Depending on the file size that will be processed, it might be required to increase the max allowed package size

```properties
[mysqld]
max_allowed_packet = 256M
```

If using a older version of MySQL, there is a [known issue](https://github.com/box/mojito/issues/120) when creating the schema. One workaround is to use `utf8`
instead `utf8mb4` but it has its limitation in term of character support.


### CLI

The default CLI configuration maps to the server default configuration and allows to access the server without
having to enter credential.

To access a production instance, the server url and port should be configured and it is also common to use the console to enter credential.

```properties
l10n.resttemplate.host=${HOSTNAME}
l10n.resttemplate.port=${PORT}
l10n.resttemplate.authentication.credentialProvider=CONSOLE
```
62 changes: 62 additions & 0 deletions docs/_docs/guides/003-creating-repository.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
---
layout: doc
title: "Creating Repository"
categories: guides
permalink: /docs/guides/creating-repository/
---

In this guide, we use `mojito-cli` to create a repository in {{ site.mojito_green }}. Repository is a container for strings and their translations. It also stores localization configurations such as locales and integrity checkers.


### Creating Repository

mojito repo-create -n MyRepo -d "Project A" -l de-DE es-ES fr-FR ja-JP


This creates a repository with name `MyRepo` with description `Project A`. Description is optional.


It is configured with locales `de-DE es-ES fr-FR ja-JP`. These locales are used to create translation requests to translators and to generate localized resource files. For more information about locales, see [Managing Locales]({{ site.url }}/docs/guides/managing-locales/).


You can now see the repository `MyRepo` in the Webapp.


![Creating Repository](./images/creating-repository.png)



### Creating Repository with Integrity Checker

mojito repo-create -n MyRepo -it resw:COMPOSITE_FORMAT -l fr-FR


This creates a repository with name `MyRepo` with locales `fr-FR`.


The repository is configured to use `COMPOSITE_FORMAT` integrity checker for files with `resw` extension. Integrity checkers are used to validate translations. Integrity checker configuration is optional but it is highly recommended to catch translations with errors and reject them. See [Integrity Checkers]({{ site.url }}/docs/guides/integrity-checkers/) for more information.



### Updating Locales in Repository

mojito repo-update -n MyRepo -l es-ES fr-FR ja-JP zh-CN zh-TW


This updates locales for the repository to `es-ES fr-FR ja-JP zh-CN zh-TW`.


### Renaming Repository

mojito repo-update -n MyRepo -nn ProjectA


This updates the name of the repository from `MyRepo` to `ProjectA`.


### Deleting Repository

mojito repo-delete -n MyRepo


This deletes the repository `MyRepo` and it is no longer visible from the Webapp.
Loading