Skip to content

Commit

Permalink
Added Hungarian translation
Browse files Browse the repository at this point in the history
  • Loading branch information
OmGodse committed Feb 20, 2021
1 parent 040d61a commit 644fe04
Show file tree
Hide file tree
Showing 10 changed files with 292 additions and 29 deletions.
1 change: 1 addition & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* 🇪🇸 Spanish by Jose Casas
* 🇺🇦 Ukrainian by Alex Shpak
* 🇸🇪 Swedish by Erik Lindström
* 🇭🇺 Hungarian by Helpful User
* 🇷🇺 Russian by Denis Bondarenko
* 🇫🇷 French by Arnaud Dieumegard
* 🇧🇷 Brazilian Portuguese by [fabianski7](https://github.com/fabianski7)
Expand Down
8 changes: 4 additions & 4 deletions Post/build.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
plugins {
id 'com.android.library'
id 'kotlin-android'
id "com.android.library"
id "kotlin-android"
}

android {
compileSdkVersion rootProject.ext.compileSDKVersion
buildToolsVersion "29.0.3"
buildToolsVersion '30.0.3'

defaultConfig {
minSdkVersion rootProject.ext.minSDKVersion
Expand All @@ -17,7 +17,7 @@ android {
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
proguardFiles getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro"
}
}
}
Expand Down
80 changes: 61 additions & 19 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,29 +1,36 @@
plugins {
id 'com.android.application'
id 'kotlin-android'
id 'kotlin-kapt'
id 'kotlin-parcelize'
id "com.android.application"
id "kotlin-android"
id "kotlin-kapt"
id "kotlin-parcelize"
}

android {
compileSdkVersion rootProject.ext.compileSDKVersion
buildToolsVersion "29.0.3"
buildToolsVersion "30.0.3"

defaultConfig {
applicationId "com.omgodse.notally"
minSdkVersion rootProject.ext.minSDKVersion
targetSdkVersion rootProject.ext.targetSDKVersion
versionCode 28
versionName "3.3"
resConfigs 'en', 'ca', 'cs', 'de', 'es', 'fr', 'in', 'it', 'nb', 'nl', 'pl', 'pt-rBR', 'ru', 'sv', 'tl', 'uk'
versionCode 29
versionName "3.4"
resConfigs "en", "ca", "cs", "de", "es", "fr", "hu", "in", "it", "nb", "nl", "pl", "pt-rBR", "ru", "sv", "tl", "uk"
vectorDrawables.generatedDensities = []
}

kapt {
arguments {
arg("room.schemaLocation", "$projectDir/schemas")
}
}

buildTypes {
release {
crunchPngs false
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
proguardFiles getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro"
}
}

Expand All @@ -32,22 +39,20 @@ android {
targetCompatibility JavaVersion.VERSION_1_8
}

kotlinOptions { jvmTarget = JavaVersion.VERSION_1_8.toString() }
kotlinOptions { jvmTarget = JavaVersion.VERSION_1_8 }

buildFeatures { viewBinding true }

aaptOptions { cruncherEnabled false }
}

dependencies {
final def roomVersion = "2.2.6"
final def stableNavVersion = "2.3.2"
final def stableNavVersion = "2.3.3"

implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlinVersion"
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion"

implementation 'androidx.preference:preference-ktx:1.1.1'
implementation "androidx.preference:preference-ktx:1.1.1"

implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.2.0'
implementation "androidx.lifecycle:lifecycle-livedata-ktx:2.3.0"

kapt "androidx.room:room-compiler:$roomVersion"
implementation "androidx.room:room-ktx:$roomVersion"
Expand All @@ -56,8 +61,45 @@ dependencies {
implementation "androidx.navigation:navigation-ui-ktx:$stableNavVersion"
implementation "androidx.navigation:navigation-fragment-ktx:$stableNavVersion"

implementation 'org.ocpsoft.prettytime:prettytime:4.0.6.Final'
implementation 'com.google.android.material:material:1.3.0-rc01'
implementation "org.ocpsoft.prettytime:prettytime:4.0.6.Final"
implementation "com.google.android.material:material:1.3.0"

implementation project(":Post")
}

/**
* This is a neat script I've made that outputs the translatable strings in
* the main`values.xml` file to a CSV file in the `build` dir of the module.
* (Useful for giving to translators)
*
* If you are looking to use this in your project as well, bear in mind that
* this is a custom solution. It does not handle edge cases such as quotation marks
* or commas in strings.
*
* To run, use the integrated terminal window in Android Studio or navigate to the
* root directory of your project and type `gradlew CSV`
*/
tasks.register("CSV") {
def csv = file("$buildDir/Notally Translations.csv")
def strings = file("$projectDir/src/main/res/values/strings.xml")

implementation project(':Post')
def writer = csv.newWriter("UTF-8")
writer.writeLine("English Phrases , Translated Phrases")

new XmlParser().parse(strings).iterator().forEachRemaining { Node node ->
if (isTranslatable(node)) {
writer.writeLine(node.text() + " , ")
}
}

writer.close()
}

private static boolean isTranslatable(Node node) {
def translatable = true
def translatableAttribute = node.attribute("translatable")
if (translatableAttribute != null) {
translatable = Boolean.parseBoolean(translatableAttribute)
}
return translatable
}
121 changes: 121 additions & 0 deletions app/schemas/com.omgodse.notally.room.NotallyDatabase/1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
{
"formatVersion": 1,
"database": {
"version": 1,
"identityHash": "561523a76ccf21fe0a7ff6c1fef657a9",
"entities": [
{
"tableName": "BaseNote",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `type` TEXT NOT NULL, `folder` TEXT NOT NULL, `title` TEXT NOT NULL, `pinned` INTEGER NOT NULL, `timestamp` INTEGER NOT NULL, `labels` TEXT NOT NULL, `body` TEXT NOT NULL, `spans` TEXT NOT NULL, `items` TEXT NOT NULL)",
"fields": [
{
"fieldPath": "id",
"columnName": "id",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "type",
"columnName": "type",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "folder",
"columnName": "folder",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "title",
"columnName": "title",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "pinned",
"columnName": "pinned",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "timestamp",
"columnName": "timestamp",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "labels",
"columnName": "labels",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "body",
"columnName": "body",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "spans",
"columnName": "spans",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "items",
"columnName": "items",
"affinity": "TEXT",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"id"
],
"autoGenerate": true
},
"indices": [
{
"name": "index_BaseNote_id_folder_pinned_timestamp_labels",
"unique": false,
"columnNames": [
"id",
"folder",
"pinned",
"timestamp",
"labels"
],
"createSql": "CREATE INDEX IF NOT EXISTS `index_BaseNote_id_folder_pinned_timestamp_labels` ON `${TABLE_NAME}` (`id`, `folder`, `pinned`, `timestamp`, `labels`)"
}
],
"foreignKeys": []
},
{
"tableName": "Label",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`value` TEXT NOT NULL, PRIMARY KEY(`value`))",
"fields": [
{
"fieldPath": "value",
"columnName": "value",
"affinity": "TEXT",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"value"
],
"autoGenerate": false
},
"indices": [],
"foreignKeys": []
}
],
"views": [],
"setupQueries": [
"CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)",
"INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, '561523a76ccf21fe0a7ff6c1fef657a9')"
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import androidx.recyclerview.widget.RecyclerView
import androidx.recyclerview.widget.StaggeredGridLayoutManager
import com.google.android.material.dialog.MaterialAlertDialogBuilder
import com.omgodse.notally.R
import com.omgodse.notally.activities.MainActivity
import com.omgodse.notally.activities.MakeList
import com.omgodse.notally.activities.TakeNote
import com.omgodse.notally.databinding.FragmentNotesBinding
Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/layout/fragment_notes.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/FrameLayout"
android:layout_width="match_parent"
android:layout_height="match_parent">

Expand Down
100 changes: 100 additions & 0 deletions app/src/main/res/values-hu/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Fragment Titles -->
<string name="notes">Jegyzetek</string>
<string name="labels">Címkék</string>
<string name="deleted">Kuka</string>
<string name="archived">Archivált</string>
<string name="settings">Beállítások</string>

<!-- Menu Options -->
<string name="share">Megosztás</string>
<string name="search">Keresés</string>
<string name="delete">Törlés</string>
<string name="restore">Visszaállítás</string>
<string name="archive">Archiválás</string>
<string name="unarchive">Archiválás visszavonása</string>
<string name="delete_forever">Végleges törlés</string>

<!-- Pinning -->
<string name="pin">Rögzítés</string>
<string name="unpin">Feloldás</string>
<string name="pinned">Kitűzve</string>

<!-- Chooser dialog hints -->
<string name="view_note">Megtekintés…</string>
<string name="share_note">Megosztás…</string>

<!-- Dialogs -->
<string name="save">Mentés</string>
<string name="edit">Szerkesztés</string>
<string name="cancel">Mégse</string>
<string name="make_list">Lista</string>
<string name="take_note">Feljegyzés</string>
<string name="add_label">Címke létrehozása</string>
<string name="export">Exportálás</string>
<string name="plain_text">Sima szöveg</string>
<string name="save_to_device">Mentés az eszközre</string>
<string name="edit_label">Címke szerkesztése</string>
<string name="label_exists">A címke már létezik</string>
<string name="delete_label">Törölni szeretnéd a címkét?</string>
<string name="create_new">Nincsenek címkék. Szeretnél készíteni egyet?</string>
<string name="delete_note_forever">Véglegesen törölni szeretné a jegyzetet?</string>
<string name="your_notes_associated">A jegyzetek ezzel a címkével nem kerülnek törlésre</string>

<!-- Lists and Notes -->
<string name="note">Jegyzet</string>
<string name="item">Elem</string>
<string name="date">Dátum</string>
<string name="title">Cím</string>
<string name="add_item">Elem hozzáadása</string>
<string name="one_more_item">még 1 elem</string>
<string name="more_items">%1$d több elem</string>
<string name="drag_handle">Megfogó nyél</string>
<string name="bold">Félkövér</string>
<string name="link">Hivatkozás</string>
<string name="italic">Dőlt</string>
<string name="strikethrough">Áthúzás</string>
<string name="clear_formatting">Formázás törlése</string>
<string name="monospace">Állandó szélességű</string>

<!-- Miscellaneous -->
<string name="saved_to_device">Elmentve az eszközre</string>
<string name="saved_to_notally">Elmentve a Notally -ban</string>
<string name="empty_note">Üres jegyzet</string>
<string name="empty_list">Üres lista</string>
<string name="discarded_empty_note">Elvetett üres jegyzet</string>
<string name="discarded_empty_list">Elvetett üres lista</string>
<string name="cant_open_link">A hivatkozás nem nyitható meg</string>
<string name="something_went_wrong">Valami elromlott. Kérlek próbáld újra</string>

<!-- Settings Page -->
<string name="appearance">Megjelenés</string>

<string name="view">Nézet</string>
<string name="list">Lista</string>
<string name="grid">Rács</string>

<string name="theme">Téma</string>
<string name="light">Világos</string>
<string name="dark">Sötét</string>
<string name="follow_system">Rendszer követése</string>

<string name="card_type">Kártya típusa</string>
<string name="elevated">Lebegő</string>
<string name="flat">Lapos</string>

<string name="content_density">Tartalom sűrűsége</string>
<string name="max_items_to_display">Elemek száma egy listában</string>
<string name="max_lines_to_display">Sorok száma egy jegyzetben</string>

<string name="show_date_created">Létrehozási dátum</string>

<string name="backup">Biztonsági mentés</string>
<string name="export_notes_to_a_file">Jegyzetek exportálása fájlba</string>
<string name="import_notes_from_a_file">Jegyzetek importálása fájlból</string>

<string name="about">Névjegy</string>
<string name="libraries">Könyvtárak</string>
<string name="rate">Értékeld ezt az alkalmazást</string>
</resources>
Loading

0 comments on commit 644fe04

Please sign in to comment.