Skip to content
This repository was archived by the owner on Feb 4, 2020. It is now read-only.

Commit 4fd8b58

Browse files
committed
Merge branch 'master' into Norwegian
2 parents 1fb0a9a + a725f89 commit 4fd8b58

51 files changed

Lines changed: 3018 additions & 22 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,15 @@
22
.gradle
33
/local.properties
44
.idea
5+
/key.store
56
.DS_Store
67
/build
78
/captures
89
/dictionary/words_from_aosp.xml
910
src/main/res/raw/*
1011
src/main/res/values/words_dict_array.xml
1112
LanguagePack-release.apk
13+
dictionary/words_merged.xml
14+
dictionary/words_from_texts.xml
15+
16+
*.apk

README.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
This is the common template for language Packs for the [AnySoftKeyboard](https://github.com/AnySoftKeyboard/AnySoftKeyboard) app for Android devices.
2+
Each pack can contain and provide multiple keyboards or dictionaries for auto correction.
3+
Most packs are maintained here as [branches of the repository](https://github.com/AnySoftKeyboard/LanguagePack/branches) and published to Google Play Store and F-Droid repository. There are some packs maintained as community forks, here on GitHub or not open source at all. Some of these are:
4+
5+
* [NEO2](https://github.com/kertase/neo_anysoftkeyboard)
6+
* [Magyar (Hungarian)](https://github.com/rhornig/anysoftkeyboard-hungarian)
7+
* [Swiss](https://play.google.com/store/apps/details?id=ch.masshardt.anysoftkeyboard.swisslanguagepack)
8+
* [Pali (Indian)](https://github.com/yuttadhammo/ask-pali-keyboard)
9+
* [Malayalam, Kannada and other Indian](https://sriandroid.wordpress.com/)
10+
* [SSH](https://github.com/pi3ch/ssh_anysoftkeyboard)
11+
* [Dutch](https://github.com/OpenTaal/LanguagePack/tree/Dutch)
12+
13+
To start a new pack, follow this checklist:
14+
15+
1. Fork this repository.
16+
1. Create a new branch, name it after the language.
17+
1. In Android Studio, Refactor->Rename the folder/package com.anysoftkeyboard.languagepack.languagepack in the project tree, replacing the last `languagepack` with the name of the language. This will automatically change it at a couple of other locations.
18+
1. Change `applicationId` in `build.gradle` in the same way.
19+
1. Edit `src/main/res/xml/keyboards.xml` according to the comments in it. It references `src/main/res/xml/qwerty.xml`, so edit this as well. Have a look at all the other Language Pack branches, to get an idea, what is possible and how to correctly configure a keyboard.
20+
1. If you want to add more keyboards, you can do this by copying `qwerty.xml` and add a <keyboard> element in `keyboards.xml`. The user can pre-select in the ASK settings, which keyboards she would like to have available for toggling through.
21+
1. Edit `src/main/res/xml/dictionaries.xml`
22+
1. Edit `src/main/res/values/strings.xml`, change the strings there and possibly add some more which are referenced in the other xml files. Also, create a new folder `src/main/res/values-XX`, where `XX` is the correspondent two-letter ISO 639-1 language code.
23+
1. Edit (e.g. via Inkscape) one of the files in `src/main/svg-png/flag/` to represent the language, e.g. by using the flag from Wikipedia (the flag has to be placed on the right edge of the document and have the full height).
24+
1. Rebuild the drawables with `./gradlew svgToDrawablePng` or "Build" -> "Rebuild Project" in Android Studio. Drawables will be generated at `src/main/res/mipmap-*/`.
25+
1. Choose whether you like the standard or the broad variant and set that as application's `android:icon` in `src/main/AndroidManifest.xml`.
26+
1. You can also add a new `src/main/res/drawable/flag.png` and reference it in the `iconResId=""` attribute in the keyboards.xml.
27+
1. Put the source files for the dictionary into the dictionary/ directory. Take special care to take the conditions of the license into account, under which you obtained the data.
28+
1. Change the build.gradle to use and configure the tasks necessary. There are several different variants ([more Information](https://github.com/AnySoftKeyboard/AnySoftKeyboardTools/blob/master/README.md)):
29+
* `GenerateWordsListTask`
30+
* `GenerateWordsListFromAOSPTask`
31+
* `MergeWordsListTask`
32+
1. Change the README.md to reflect the characteristics of your pack
33+
1. Make some screenshots and replace the files in the `src/main/play/` folder. One of them should be a 1024x500 banner.
34+
1. If a branch of the language does not exist, [open an issue](https://github.com/AnySoftKeyboard/LanguagePack/issues/new) to request the creation of a new branch. As soon, as it is created, you can make a Pull Request from your forked branch to the one in the original repository. Provide translations of the following strings to your language:
35+
* title: "LANGUAGE Language Pack"
36+
* promo: "LANGUAGE language pack for AnySoftKeyboard"
37+
* description: "AnySoftKeyboard keyboards pack:
38+
LANGUAGE keyboard and dictionary.
39+
40+
This is an expansion pack for AnySoftKeyboard.
41+
Install AnySoftKeyboard first, and then select the desired layout from AnySoftKeyboard's Settings->Keyboards menu."
42+
43+
When it is merged, it can take a couple of days, until it is also distributed via Play Store and F-Droid.

StoreStuff/feature_graphics.png

-347 KB
Binary file not shown.

StoreStuff/store_hi_res_icon.png

-36.3 KB
Binary file not shown.

build.gradle

Lines changed: 118 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,76 @@
11
import com.anysoftkeyboard.tools.generatewordslist.GenerateWordsListFromAOSPTask
2+
import com.anysoftkeyboard.tools.generatewordslist.GenerateWordsListTask
3+
import com.anysoftkeyboard.tools.generatewordslist.MergeWordsListTask
24
import com.anysoftkeyboard.tools.makedictionary.MakeDictionaryTask
5+
import fr.avianey.androidsvgdrawable.gradle.SvgDrawableTask
6+
import net.evendanan.versiongenerator.generators.EnvBuildVersionGenerator
7+
import net.evendanan.versiongenerator.generators.GitBuildVersionGenerator
8+
import net.evendanan.versiongenerator.generators.StaticVersionGenerator
9+
10+
System.setProperty("file.encoding", "UTF-8")
311

412
buildscript {
513
repositories {
14+
google()
615
jcenter()
16+
mavenCentral()
717
maven { url 'https://jitpack.io' }
18+
maven { url "https://plugins.gradle.org/m2/" }
819
}
920
dependencies {
10-
classpath 'com.android.tools.build:gradle:2.2.3'
21+
classpath 'com.android.tools.build:gradle:3.1.0-beta4'
1122

12-
classpath 'com.github.AnySoftKeyboard.AnySoftKeyboardTools:makedictionary:99bd3e6'
13-
classpath 'com.github.AnySoftKeyboard.AnySoftKeyboardTools:generatewordslist:99bd3e6'
23+
classpath 'com.github.AnySoftKeyboard.AnySoftKeyboardTools:makedictionary:287fe7812294918636359e4d28dbcbc931f3dab8'
24+
classpath 'com.github.AnySoftKeyboard.AnySoftKeyboardTools:generatewordslist:287fe7812294918636359e4d28dbcbc931f3dab8'
25+
//classpath files('english_dictionary/generatewordslist-1.0-SNAPSHOT.jar')
1426
classpath 'org.jsoup:jsoup:1.9.1'
27+
28+
classpath 'com.github.Triple-T:gradle-play-publisher:8cda31a5d0e3c4f2d7f47ffde6fc3b370e59dd8a'
29+
30+
classpath 'com.github.menny:GradleVersion:0.0.4'
31+
32+
classpath('fr.avianey.androidsvgdrawable:gradle-plugin:3.0.0') {
33+
exclude group: 'xerces'
34+
}
1535
}
1636
}
1737

38+
apply plugin: 'checkstyle'
1839
apply plugin: 'com.android.application'
40+
apply plugin: 'com.github.triplet.play'
41+
apply plugin: 'net.evendanan.versiongenerator'
42+
apply plugin: "androidsvgdrawable"
43+
44+
45+
def generators = [
46+
new EnvBuildVersionGenerator.CircleCi(0,0),
47+
new GitBuildVersionGenerator(0,0),
48+
new StaticVersionGenerator()
49+
]
50+
51+
def versionData = versionGenerator.generateVersion(1, 0, 0, generators)
1952

2053
android {
21-
compileSdkVersion 25
22-
buildToolsVersion '25.0.2'
54+
compileSdkVersion 27
55+
buildToolsVersion '27.0.3'
2356

2457
defaultConfig {
2558
applicationId "com.anysoftkeyboard.languagepack.norwegian"
26-
minSdkVersion 7
27-
targetSdkVersion 25
28-
versionCode 101
29-
versionName "2.0.1"
59+
minSdkVersion 9
60+
targetSdkVersion 27
61+
versionName versionData.versionName
62+
versionCode versionData.versionCode
63+
64+
// change name of generated apk to make previews and testing of multiple packs easier
65+
def packName = applicationId.substring(applicationId.lastIndexOf(".") + 1)
66+
setProperty("archivesBaseName", "ASKLangPack-${packName}-${versionCode}")
67+
68+
println "Building ${applicationId} v${versionName}, version-code ${versionCode}..."
3069
}
3170

3271
signingConfigs {
3372
release {
34-
storeFile file("key.store")
73+
storeFile file("/tmp/language_pack.keystore")
3574
storePassword System.getenv("PACK_KEYSTORE_PASSWORD")
3675
keyAlias System.getenv("PACK_KEYSTORE_ALIAS")
3776
keyPassword System.getenv("PACK_KEYSTORE_KEY_PASSWORD")
@@ -57,12 +96,26 @@ task parseAospForDictionary(type: GenerateWordsListFromAOSPTask) {
5796
maxWordsInList 300000
5897
}
5998

60-
task makeDictionary(type: MakeDictionaryTask) {
61-
doFirst {
62-
mkdir 'src/main/res/raw'
63-
}
99+
play {
100+
track = 'alpha'
101+
serviceAccountEmail = System.getenv("PUBLISH_APK_SERVICE_ACCOUNT_EMAIL")
102+
pk12File = file('/tmp/apk_upload_key.p12')
103+
uploadImages = true
104+
}
105+
106+
task mergeAllWordLists(type: MergeWordsListTask) {
64107
dependsOn parseAospForDictionary
65-
inputWordsListFile new File(project.getProjectDir(), "dictionary/words_from_aosp.xml")
108+
109+
inputWordsListFiles = [
110+
new File(project.getProjectDir(), "dictionary/words_from_aosp.xml"),
111+
] as File[]
112+
outputWordsListFile new File(project.getProjectDir(), "dictionary/words_merged.xml")
113+
maxWordsInList 300000
114+
}
115+
116+
task makeDictionary(type: MakeDictionaryTask) {
117+
dependsOn mergeAllWordLists
118+
inputWordsListFile new File(project.getProjectDir(), "dictionary/words_merged.xml")
66119
}
67120

68121
afterEvaluate { proj ->
@@ -75,9 +128,58 @@ afterEvaluate { proj ->
75128

76129
dependencies {
77130
repositories {
131+
google()
78132
jcenter()
79133
maven { url "https://jitpack.io" }
80134
}
81-
compile 'com.github.AnySoftKeyboard:AnySoftKeyboard-API:1.7.0'
135+
api 'com.github.AnySoftKeyboard:AnySoftKeyboard-API:1.10.0'
136+
}
137+
138+
task checkstyle(type: Checkstyle) {
139+
configFile file("${projectDir}/checkstyle/checkstyle.xml")
140+
source 'src'
141+
classpath = files()
142+
}
143+
144+
// create app icon in all necessary sizes, automatically adding flag
145+
task svgToDrawablePng(type: SvgDrawableTask) {
146+
// specify where to pick SVG from
147+
from = files('src/main/svg-png/dummy')
148+
// specify the android res folder
149+
to = file('src/main/res')
150+
// create qualified directories if missing
151+
createMissingDirectories = true
152+
// override files only if necessary
153+
overwriteMode = 'ifModified'
154+
// generate PNGs for the following densities
155+
targetedDensities = ['ldpi', 'hdpi', 'mdpi', 'xhdpi', 'xxhdpi', 'xxxhdpi']
156+
157+
outputFormat = 'PNG'
158+
outputType = 'mipmap'
159+
160+
// composition of SVGs
161+
svgMaskFiles = files('src/main/svg-png/mask-launcher')
162+
svgMaskResourceFiles = files('src/main/svg-png/flag')
82163
}
83164

165+
// create app icon in all necessary sizes, automatically adding flag
166+
task svgToDrawablePngPlay(type: SvgDrawableTask) {
167+
// specify where to pick SVG from
168+
from = files('src/main/svg-png/dummy')
169+
// specify the android res folder
170+
to = file('src/main/play/en-US/listing/icon')
171+
// create qualified directories if missing
172+
createMissingDirectories = true
173+
// override files only if necessary
174+
overwriteMode = 'ifModified'
175+
176+
outputFormat = 'PNG'
177+
outputType = 'raw'
178+
179+
// composition of SVGs
180+
svgMaskFiles = files('src/main/svg-png/mask-play')
181+
svgMaskResourceFiles = files('src/main/svg-png/flag')
182+
doLast {
183+
file('src/main/play/en-US/listing/icon/logo_launcher.png').renameTo(file('src/main/play/en-US/listing/icon/ask_logo.png'))
184+
}
185+
}

0 commit comments

Comments
 (0)