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

mklanguages: Manage language lists in donottranslate.xml #3621

Closed
wants to merge 86 commits into from
Closed

mklanguages: Manage language lists in donottranslate.xml #3621

wants to merge 86 commits into from

Conversation

nikclayton
Copy link
Contributor

mklanguages processes values-*/strings.xml entries and uses that to determine which languages can be used.

It uses the ICU database to generate the display name for each language, and to list them in sorted order.

Add runtools scripts to make it easy to run this and other tools.

Update donottranslate.xml with comments that show the language code and English name for each language.

mklanguages processes values-*/strings.xml entries and uses that to determine
which languages can be used.

It uses the ICU database to generate the display name for each language,
and to list them in sorted order.

Add `runtools` scripts to make it easy to run this and other tools.

Update donottranslate.xml with comments that show the language code and
English name for each language.
@nikclayton
Copy link
Contributor Author

nikclayton commented May 4, 2023

FYI: I'm thinking there are a few things we might want to create as tools

  • Something that can process a JSON file provided by a user and try and parse it as a timeline or similar using the existing Tusky data structures. Should be helpful for diagnosing crashes
    • Note that that's difficult to do at the moment, because all the Tusky code is in a single module, so command line tools can't import Tusky types for parsing the Mastodon API. Modularisation like Extract database code to a separate module #3410 would need to happen.
  • Small tools to make some of the release process chores easier (tagging, merging, managing changelogs, etc).

@nikclayton nikclayton requested a review from connyduck May 4, 2023 16:23
@nikclayton
Copy link
Contributor Author

nikclayton commented May 4, 2023

Oh, something else this code could do in the future -- if you want to have some threshold on the "quality" of a translation before it's listed in the languages arrays, this could would be the place to do that decision making.

Some future criteria might be:

  • Number of strings translated
  • Are some "core" strings translated (e.g., all top level menu and timeline names)?
  • Is everything associated with a particular timeline translated

Don't want to define them now, that's just some ideas for the future.

@connyduck
Copy link
Collaborator

So much added complexity just for some languages that need to be updated like 4 times a year? I wouldn't do that.

@nikclayton
Copy link
Contributor Author

Here's the alternative:

Every time we add a new language someone has to:

  • Figure out the correct way to write the name of that language
  • Figure out how the name of the language should be sorted relative to the other languages
  • Modify the language_entries and language_values arrays and keep them in sync

Because it's only done a few times a year it requires whoever does that to effectively do it from scratch every time -- anything they learned the last time they did it (and there's no guarantee they were the last person to do it) they've probably forgotten.

So it's incredibly easy to get wrong. This PR is proof -- the previous version of the donottranslate.xml file had Esperanto and Español in the wrong order because someone (I don't know who, and I'm not looking it up because this isn't about assigning blame) got it wrong. There were similar mistakes for the different variants of Chinese.

https://github.com/tuskyapp/Tusky/pull/3574/files is another example. That adds "Odia" as a translation.

What's the correct name to use for that language (it's not "Odia"), and where should it go in the sorted list?

With this PR I get the answer in about a second, and a change I can commit and submit as a PR, confident that it's correct. Without it you have to do a bunch of time consuming research. Then whoever reviews the PR has to confirm that the research is correct.

@connyduck
Copy link
Collaborator

Ok, can you add tests for this?

Nik Clayton added 5 commits May 10, 2023 11:17
- Move parsing "values-*" in to its own class
- Use proper parsing techniques
- Add tests
- Update Berber language code and script tag
# Conflicts:
#	app/src/main/res/values/donottranslate.xml
@nikclayton
Copy link
Contributor Author

Ok, can you add tests for this?

Done.

@nikclayton nikclayton requested review from Tak, DavidEdwards, Lakoja and charlag and removed request for connyduck August 4, 2023 12:06
Nik Clayton and others added 10 commits August 22, 2023 22:34
Read/write to the cache for nightly / release builds, read from the
cache for other builds.
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
|
[androidx.fragment:fragment-ktx](https://developer.android.com/jetpack/androidx/releases/fragment#1.6.1)
([source](https://cs.android.com/androidx/platform/frameworks/support))
| `1.6.0` -> `1.6.1` |
[![age](https://developer.mend.io/api/mc/badges/age/maven/androidx.fragment:fragment-ktx/1.6.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/androidx.fragment:fragment-ktx/1.6.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/androidx.fragment:fragment-ktx/1.6.0/1.6.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/androidx.fragment:fragment-ktx/1.6.0/1.6.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/tuskyapp/Tusky).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi4xMS4wIiwidXBkYXRlZEluVmVyIjoiMzYuMTEuMCIsInRhcmdldEJyYW5jaCI6ImRldmVsb3AifQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
|
[androidx.paging:paging-runtime-ktx](https://developer.android.com/jetpack/androidx/releases/paging#3.2.0)
([source](https://cs.android.com/androidx/platform/frameworks/support))
| `3.1.1` -> `3.2.0` |
[![age](https://developer.mend.io/api/mc/badges/age/maven/androidx.paging:paging-runtime-ktx/3.2.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/androidx.paging:paging-runtime-ktx/3.2.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/androidx.paging:paging-runtime-ktx/3.1.1/3.2.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/androidx.paging:paging-runtime-ktx/3.1.1/3.2.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/tuskyapp/Tusky).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi4xMS4wIiwidXBkYXRlZEluVmVyIjoiMzYuMTEuMCIsInRhcmdldEJyYW5jaCI6ImRldmVsb3AifQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Small improvement to the behavior on bad/disconnected networks

Fixes #3773
Currently translated at 100.0% (609 of 609 strings)

Co-authored-by: Ihor Hordiichuk <[email protected]>
Translate-URL: https://weblate.tusky.app/projects/tusky/tusky/uk/
Translation: Tusky/Tusky
Currently translated at 100.0% (31 of 31 strings)

Translation: Tusky/Tusky description
Translate-URL: https://weblate.tusky.app/projects/tusky/tusky-app/uk/
Currently translated at 12.9% (4 of 31 strings)

Translation: Tusky/Tusky description
Translate-URL: https://weblate.tusky.app/projects/tusky/tusky-app/el/
mastoduy and others added 29 commits August 22, 2023 22:34
Currently translated at 100.0% (616 of 616 strings)

Co-authored-by: Hồ Nhất Duy <[email protected]>
Translate-URL: https://weblate.tusky.app/projects/tusky/tusky/vi/
Translation: Tusky/Tusky
Expectation is that these will result in faster builds by disabling
options (like the gradle daemon) that benefit long-lived processes but
do not benefit ephemeral build workers.
Using the same background and margin as the ALT button.

Fixes #3772
Avatars that are semi-transparent are a problem when viewing a thread,
as the line that connects different statuses in the same thread is drawn
underneath the avatar and is visible.

Fix this with a CompositeWithOpaqueBackground Glide transformation that:

1. Extracts the alpha channel from the avatar image
2. Converts the alpha to a 1bpp mask
3. Draws that mask on a new bitmap, with the appropriate background
colour
4. Draws the original bitmap on top of that

So any partially transparent areas of the original image are drawn over
a solid background colour, so anything drawn under them will not appear.
Currently translated at 100.0% (616 of 616 strings)

Co-authored-by: puf <[email protected]>
Translate-URL: https://weblate.tusky.app/projects/tusky/tusky/cy/
Translation: Tusky/Tusky
Currently translated at 100.0% (616 of 616 strings)

Co-authored-by: Ihor Hordiichuk <[email protected]>
Translate-URL: https://weblate.tusky.app/projects/tusky/tusky/uk/
Translation: Tusky/Tusky
Currently translated at 100.0% (616 of 616 strings)

Co-authored-by: GunChleoc <[email protected]>
Translate-URL: https://weblate.tusky.app/projects/tusky/tusky/gd/
Translation: Tusky/Tusky
Currently translated at 100.0% (31 of 31 strings)

Translation: Tusky/Tusky description
Translate-URL: https://weblate.tusky.app/projects/tusky/tusky-app/cy/
Previously, the thread indicator would start at the top of the avatar
for the status at the start of the thread, and end at the top of the
avatar for the status at the end of the thread.

If these avatars were partially transparent the thread indicator could
either (a) poke out of the top of the avatar at the start of the thread,
(b) not properly connect with the avatar at the end of the thread, or
(c) both.

Partially fix this by making the divider start/stop in the middle of the
avatar. This assumes that this area will typically have opaque content,
even if some of the rest of the avatar is transparent. This is not
always true, but it's still better than the current behaviour.
Behaviour is consistent with previous player except that:

- Swapping apps while a video is playing, and then returning to Tusky,
will keep the seek position in the video instead of returning to the
start
- The controls/media description can be shown by tapping anywhere, not
just on the video itself
- The media description is on-screen for the same duration as the player
controls (5 seconds here, 3 seconds in the previous code)
- The user has options to control the playback speed
- Rotating the device does not squash/stretch the video
- Show the media preview when playing audio-only files

Fixes #3329,
#3141,
#3126,
#2753,
#3508,
#3291

---------

Co-authored-by: mcc <[email protected]>
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
|
[org.mockito.kotlin:mockito-kotlin](https://togithub.com/mockito/mockito-kotlin)
| `5.0.0` -> `5.1.0` |
[![age](https://developer.mend.io/api/mc/badges/age/maven/org.mockito.kotlin:mockito-kotlin/5.1.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/org.mockito.kotlin:mockito-kotlin/5.1.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/org.mockito.kotlin:mockito-kotlin/5.0.0/5.1.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/org.mockito.kotlin:mockito-kotlin/5.0.0/5.1.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>mockito/mockito-kotlin
(org.mockito.kotlin:mockito-kotlin)</summary>

###
[`v5.1.0`](https://togithub.com/mockito/mockito-kotlin/releases/tag/5.1.0)

[Compare
Source](https://togithub.com/mockito/mockito-kotlin/compare/5.0.0...5.1.0)

<sup><sup>*Changelog generated by [Shipkit Changelog Gradle
Plugin](https://togithub.com/shipkit/shipkit-changelog)*</sup></sup>

##### 5.1.0

- 2023-08-09 - [3
commit(s)](https://togithub.com/mockito/mockito-kotlin/compare/5.0.0...5.1.0)
by Hunter Werlla, Lukáš Křečan, Tim van der Lippe
- Also run release job on 5.x tags
[(#&#8203;491)](https://togithub.com/mockito/mockito-kotlin/pull/491)
- [#&#8203;474](https://togithub.com/mockito/mockito-kotlin/issues/474)
Fix vararg argument matcher
[(#&#8203;490)](https://togithub.com/mockito/mockito-kotlin/pull/490)
- Fix issue
[#&#8203;480](https://togithub.com/mockito/mockito-kotlin/issues/480) by
widening the allowed types for lenient().whenever()
[(#&#8203;485)](https://togithub.com/mockito/mockito-kotlin/pull/485)
- lenient().whenever() reports type mismatch TypeVariable(T) was
expected
[(#&#8203;480)](https://togithub.com/mockito/mockito-kotlin/issues/480)
- Mockito 5.0 breaks vararg argument capture in Kotlin
[(#&#8203;474)](https://togithub.com/mockito/mockito-kotlin/issues/474)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/tuskyapp/Tusky).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi40MC4zIiwidXBkYXRlZEluVmVyIjoiMzYuNDAuMyIsInRhcmdldEJyYW5jaCI6ImRldmVsb3AifQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Currently translated at 100.0% (617 of 617 strings)

Co-authored-by: puf <[email protected]>
Translate-URL: https://weblate.tusky.app/projects/tusky/tusky/cy/
Translation: Tusky/Tusky
Currently translated at 100.0% (617 of 617 strings)

Co-authored-by: Danial Behzadi <[email protected]>
Translate-URL: https://weblate.tusky.app/projects/tusky/tusky/fa/
Translation: Tusky/Tusky
Currently translated at 96.9% (598 of 617 strings)

Co-authored-by: Oliebol <[email protected]>
Translate-URL: https://weblate.tusky.app/projects/tusky/tusky/nl/
Translation: Tusky/Tusky
Currently translated at 100.0% (617 of 617 strings)

Co-authored-by: Eric <[email protected]>
Translate-URL: https://weblate.tusky.app/projects/tusky/tusky/zh_Hans/
Translation: Tusky/Tusky
Currently translated at 57.0% (352 of 617 strings)

Co-authored-by: S. Lee <[email protected]>
Translate-URL: https://weblate.tusky.app/projects/tusky/tusky/ko/
Translation: Tusky/Tusky
Currently translated at 100.0% (617 of 617 strings)

Co-authored-by: Hồ Nhất Duy <[email protected]>
Translate-URL: https://weblate.tusky.app/projects/tusky/tusky/vi/
Translation: Tusky/Tusky
Currently translated at 100.0% (617 of 617 strings)

Translated using Weblate (Vietnamese)

Currently translated at 100.0% (617 of 617 strings)

Co-authored-by: Hồ Nhất Duy <[email protected]>
Translate-URL: https://weblate.tusky.app/projects/tusky/tusky/vi/
Translation: Tusky/Tusky
Currently translated at 100.0% (617 of 617 strings)

Co-authored-by: Ümit Solmaz <[email protected]>
Translate-URL: https://weblate.tusky.app/projects/tusky/tusky/tr/
Translation: Tusky/Tusky
Currently translated at 100.0% (617 of 617 strings)

Co-authored-by: puf <[email protected]>
Translate-URL: https://weblate.tusky.app/projects/tusky/tusky/cy/
Translation: Tusky/Tusky
Prevent users from accidentally deleting filters by prompting them to confirm.

Add an AlertDialog extension that converts AlertDialog callbacks to linear control flow.

Fixes #3736.
Before, intent creation was scattered across multiple sites, with account switching logic in both `ComposeActivity` and `MainActivity`.

Now, intents are only created in `MainActivity` Companion, and account switching only occurs in `MainActivity`

Fixes #3695
The "trending" functionality will expand to include trending links and
posts. But at the moment the "Trending" references in the code are
exclusively to hashtags.

Rename "Trending" to "TrendingTags" or similar everywhere necessary in
order to prepare for this.

This includes a database migration, as the identifier for the "Trending
tags" tab in the account preferences was changed from "Trending" to
"TrendingTags". The migration updates the stored value if necessary.
…op). (#3937)

Muting your own server domain is a no-op. Check for this case, and remove the "mute" menu item if true.

Fixes #3798
Previously the notification filter and clear actions were shown as
buttons in the UI, with a preference that determined whether they were
displayed.

Remove this preference, and display them as menu items.

- "Filter notifications" is shown as an icon, if possible
- "Clear notifications" is only ever shown as a menu item, to reduce the
chance the user inadvertently selects it

To ensure that the options menu appears correctly, remove the code that
creates a "fake" action bar, and adjust the layouts so that there are
three toolbars;

- mainToolbar -- displays the icons, and the current "location" (Home,
Notifications, etc)
- topNav -- displays the row of tabs at the top
- bottomNav -- displays the row of tabs at the bottom

Only one of them is set as the support action bar (depending on the
user's preferences). This provides the "show a logo" and "show the
options menu" functionality as standard, without needing to re-implement
as the previous code did.
dc9e9f2
modifed the code that fetched the value of EXTRA_NOTIFICATION_TYPE in an
intent, to use getSerializable().

However, the value was being placed in to the intent using putString().

This caused an exception when trying to update the summary notification,
so it would never update.

```
java.lang.ClassCastException: java.lang.String cannot be cast to com.keylesspalace.tusky.entity.Notification$Type
    at com.keylesspalace.tusky.components.notifications.NotificationHelper.updateSummaryNotifications(NotificationHelper.java:321)
    at com.keylesspalace.tusky.components.notifications.NotificationFetcher.fetchAndShow(NotificationFetcher.kt:87)
    at com.keylesspalace.tusky.components.notifications.NotificationFetcher$fetchAndShow$1.invokeSuspend(Unknown Source:14)
```

Fix this by placing the value in to the intent using putSerializable(),
to match how it will be fetched.
Translations update from [Weblate](https://weblate.tusky.app) for
[Tusky/Tusky](https://weblate.tusky.app/projects/tusky/tusky/).



Current translation status:

![Weblate translation
status](https://weblate.tusky.app/widgets/tusky/-/tusky/horizontal-auto.svg)

---------

Co-authored-by: ButterflyOfFire <[email protected]>
Co-authored-by: puf <[email protected]>
Co-authored-by: Danial Behzadi <[email protected]>
Co-authored-by: Oliebol <[email protected]>
Co-authored-by: Eric <[email protected]>
Co-authored-by: Hồ Nhất Duy <[email protected]>
Co-authored-by: XoseM <[email protected]>
Co-authored-by: Nik Clayton <[email protected]>
@nikclayton nikclayton closed this by deleting the head repository Aug 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.