this post was submitted on 29 Aug 2023
24 points (92.9% liked)

Programming

14 readers
1 users here now

Welcome to the Lemmygrad programming community! This is a space where programmers of all levels can discuss programming, ask for help with problems, and share their personal programming projects with others.


Rules

  1. Respect all users, regardless of their level of knowledge in programming. We're here to learn and help each other improve.
  2. Keep posts relevant to programming and related topics.
  3. Respect people's personal preferences. If you disagree with someone's choice of programming language, method of formatting code, or anything else, don't attack the poster. Genuine criticism is fine, but personal attacks are not.
  4. In order to promote breaks from typing, all code snippets must be photos of code written on paper.
    Just kidding ;), please use proper markdown code blocks.

founded 2 years ago
MODERATORS
 

I just realized that I made my last post 3 weeks ago. In any case, I staggered my learning with building a simple starter app and just finished my last bit of logic this am. Figured I would share in hopes of some sort dopamine activity via validation.

The App:

  • Has 2 sets of strings that are common phrases that people might use while navigating eating out at restaurants where language barriers might be an issue.
  • First set in bold are translated in the app via the Language tab
  • Second smaller set are translated based on the phone's locale settings.

The idea is that the phone owner should be able to read the text as well, so I wanted 2 sets for when one party speaks one language and the other party speaks another. I mostly wanted to have the challenge of handling translations from within and outside the app and figured why not.

The phrases can be toggled with the green buttons on the bottom. This is to fine tune the dietary preferences. Vegan will toggle everything but gluten as "cannot consume" or will set it for relative vegetarian(so no meat or fish but yes dairy and eggs)

I put gluten in there for anyone who has Celiac. I have found a frightening number of waitstaff that just assume that both veganism and gluten allergy is just "fad diets" so I wanted to include both for the little bit of crossover between the 2 lifestyle diets.

Screenshot with French for phone language and Spanish for in app language:

github: https://github.com/AndroidHell/ImVeganBTW

Notes:

  • The app title translate based on phone language but it should be based on in-app language since it's meant more for the person taking a food order to know "I'm Vegan. I might have it change based on vegan or vegetarian for the in-app language but I suppose that is handled by the first card. ๐Ÿค”
  • The nav buttons are not translated and localizing those would be good
  • if text in the cards is too long, it gets cut off with ... at the end. This is a similar issue to the Jerboa app nav buttons for some languages. I might make the strings shorter(lazy route) or try to write some sort of scroll/ticker or make each card expand with full text.
  • The source code is a fucking mess. I already know. I started working on viewModel stuff before actually learning about it or app architecture.
  • Translations were done by Google Translate so if they are wrong maybe let me know and I can fix them. I only speak English so had to rely on Google on this.
  • I tried to pick main languages that I could come across in the States. I think they should work in other parts of the world but I used Mexican Spanish and Simplified Chinese so I donno how that might work out elsewhere.
top 11 comments
sorted by: hot top controversial new old
[โ€“] [email protected] 8 points 1 year ago (1 children)
[โ€“] [email protected] 8 points 1 year ago

Lol thanks! I still don't quite know what I'm doing. I need to definitely finish going over viewModel and revisit how scaffolding is supposed to work.

Kotlin is definitely weird compared to what I've done in the past but I think I like it.

[โ€“] [email protected] 4 points 1 year ago (1 children)

That's cool! You can also try using DeepL, sometimes it has better translations.

[โ€“] [email protected] 3 points 1 year ago* (last edited 1 year ago) (1 children)

I just checked out DeepL and it seems pretty cool. I like that it offers alternate phrases, even if they don't read that naturally. It's missing one language I need in my app which I guess is understandable since it's already an AI model translating 30 other languages into natural text. Paid API usages would be cool in a regular translation app. Maybe I can tackle that. Like have a box that you type in in your language and have a another with the selected language translation, just so you aren't limited to canned responses?

[โ€“] [email protected] 2 points 1 year ago (1 children)

Not sure if I understood correctly, if you have a field where you can type in your native language and then get the translation, aren't you making a translator with extra steps?

If you want to provide an APK, I'm willing to try it.

[โ€“] [email protected] 3 points 1 year ago (1 children)

I was meaning for another app idea. Just make a normal translation app lol.

[โ€“] [email protected] 2 points 1 year ago (1 children)

Ah, gotcha. There's "Translate You" on F-Droid, you might want to take a look at it for inspiration.

[โ€“] [email protected] 2 points 1 year ago (1 children)

Thanks for the suggestion. Will do!

[โ€“] [email protected] 1 points 1 year ago (1 children)

If you need testers for your apps I can try them.

I'd suggest not hosting on GitHub though, as it's Microsoft.

[โ€“] [email protected] 2 points 1 year ago (1 children)

I only used GitHub because it's an industry standard. It's on my resume and most places I'm applying at knows GitHub. I can try and get an apk made of what I currently have once I get those last few things sorted out and send that your way.

It would mostly be just testing accuracy of the translations since that's the only real feature. I guess testing on multiple screen sizes too but I've tested on 3 sizes so far.

[โ€“] [email protected] 1 points 1 year ago

Alright, you could try mirroring on places like Codeberg if it isn't a big hassle for you.

Sure! I have a few Android phones I could test it on, various screen sizes and Android versions.