Skip to content

Commit 5058490

Browse files
authored
Merge pull request #1316 from firebase/internal-docs
2 parents 8f74d2d + 0e3ee3a commit 5058490

File tree

3 files changed

+117
-0
lines changed

3 files changed

+117
-0
lines changed

docs/internal/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Internal Documentation for FirebaseUI-Android
2+
3+
This folder contains documentation needed to be a contributor or
4+
owner of this project.
5+
6+
Contents:
7+
8+
* [Branching Strategy](branching.md)
9+
* [Translations](translations.md)

docs/internal/branching.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Branching Strategy
2+
3+
## Basics
4+
5+
FirebaseUI organizes upcoming features and bugfixes via a branching system.
6+
The basic idea is:
7+
8+
* `master` - this branch contains the latest **released** code. The only
9+
commits newer than the last release should be documentation fixes.
10+
* `version-x.y.z-dev` - this branch contains ongoing work for version
11+
`x.y.z`. Normally there is only one of these branches alive at a given
12+
time, but sometimes you will see two if we are working on long-term
13+
and short-term changes.
14+
* `version-x.y.z` - these branches basically act as "tags", you can use
15+
them to easily browse the code from any past version.
16+
17+
## Dev Branches
18+
19+
Dev branches are created by picking a base branch (normally `master`) and
20+
creating a commit that modifies `constants.gradle` to use the desired `SNAPSHOT`
21+
version.
22+
23+
All unreleased work should be done as Pull Requests that target a `dev` branch.
24+
Merging a PR into a `dev` branch means it will be included in that release.
25+
26+
Whenever a commit is merged into a `dev` branch, a build on Travis CI is kicked
27+
off. If the build passes, a `SNAPSHOT` artifact is uploaded to
28+
[artifactory][artifactory].
29+
30+
[artifactory]: https://oss.jfrog.org/webapp/#/artifacts/browse/tree/General/oss-snapshot-local/com/firebaseui

docs/internal/translations.md

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
# Translations
2+
3+
All string resources in FirebaseUI are translated into a number of locales. The
4+
translation process leverages Google's internal translation pipeline, so the
5+
commands listed in this document are google specific.
6+
7+
The translation process has a few basic steps:
8+
9+
1. Export strings from the git project
10+
1. Create a CL with the exported strings
11+
1. Kick off translation by requesting "extraction"
12+
1. Wait ~1 week for strings to be translated
13+
1. Finish translation by requesting a "dump"
14+
1. Export the dumped strings
15+
1. Import the dumped strings, and clean them up
16+
17+
## 1 - Export Strings
18+
19+
From the project root, run:
20+
21+
```shell
22+
# This command will output to the console, you probably want to redirect
23+
# it to some temporary file.
24+
python ./scripts/translations/export_translations.py
25+
```
26+
27+
This will take the `strings.xml` file from the `auth` module and get it
28+
ready to be sent off for translation. Thist mostly consists of stripping
29+
the `fui_` prefixes.
30+
31+
## 2 - Create a CL
32+
33+
Overwrite the following file with the output from the previous step:
34+
35+
```
36+
google3/firebase/auth/ui/android/src/main/res/values/strings.xml
37+
```
38+
39+
## 3 - Request Extraction
40+
41+
In the Translations Console (tc/) go to the **FirebaseUI** project and
42+
click **Extract Source Messages**.
43+
44+
## 4 - Wait
45+
46+
Get a snack. Probably a few. You can check translation percentage in the
47+
console.
48+
49+
## 5 - Request Dump
50+
51+
This is the same as step 3, but click **Dump Translations**. Make sure all
52+
translations are 100% completed before doing this.
53+
54+
## 6 - Export Strings
55+
56+
In order to build out the `xml` files you'll need, run:
57+
58+
```shell
59+
blaze build firebase/auth/ui/android:translated_messages
60+
```
61+
62+
## 7 - Import and Cleanup Strings
63+
64+
First, copy the strings you just built back into the project:
65+
66+
```shell
67+
cp -r blaze-genfiles/firebase/auth/ui/android/src/main/res/values* $FBUI/auth/src/main/res/
68+
```
69+
70+
Second, in Android studio right-click on the folder containing all the
71+
auth `values` XML files and click **Reformat Code**. I don't know of any
72+
way to run an equivalent formatter at the command line.
73+
74+
Third, run the following from your project root:
75+
76+
```
77+
/scripts/translations/clean_up_translations.sh
78+
```

0 commit comments

Comments
 (0)