Luca's meaningless thoughts   SponsorGitHub SponsorsLiberapayPaypalBuy Me A CoffeePatreonFlattr

The LANGUAGE variable is broken for English as main language

by Leandro Lucarella on 2020- 11- 18 11:38 (updated on 2020- 11- 18 11:38)
tagged en, gettext, lang, language, linux - with 0 comment(s)

The LANGUAGE environment variable can accept multiple fallback languages (at least if your commands are using gettext), so if your main LANG is, say, es, but you also speak fr, then you can use LANGUAGE=es:fr.

But what happens when you main LANG is en, so for example your LANGUAGE looks like en:es:de? You'll notice some message that used to be in perfect English before using the multi-language fallback now seem to be shown randomly in es or de.

Well, it is not random. The thing is, since English tends to be the de-facto language for the original strings in a program, it looks like almost nobody provides an en translation, so when fallback is active, almost no programs will show messages in English.

For example, this is my Debian testing system with roughly 3.5K packages installed:

$ dpkg -l |wc -l
$ ls /usr/share/locale/en/LC_MESSAGES/ | wc -l

Only 12 packages have a plain English locale. en_GB does a bit better:

$ ls /usr/share/locale/en_GB/LC_MESSAGES/ | wc -l

732 packages. This is still lower than both en and de:

$ ls /usr/share/locale/es/LC_MESSAGES/ | wc -l
$ ls /usr/share/locale/de/LC_MESSAGES/ | wc -l

The weird thing is packages as basic as psmisc (providing, for example, killall) and coreutils (providing, for example, ls) don't have an en locale, and psmisc doesn't provide es. This is why at some point it seemed like a random locale was being used. I had something like LANGUAGE=en_GB:en_US:en:es:de and I use KDE as my desktop environment. KDE seems to be correctly translated to en_GB, so I was seeing most of my desktop in English as expected, but when using killall, I got errors in German, and when using ls, I got errors in Spanish.

If you don't provide other fallback languages, gettext will automatically fall back to the C locale, which is the original strings embedded in the source code, which are usually in English, and this is why if you don't provide fallback languages (other than English at least), all will work in English as expected. Of course if you use C in your fallback languages, before any non-English language, then they will be ignored as the C locale should always be present, so that's not an option.

I find it very curious that this issue has almost zero visibility. At least my searches for the issue didn't throw any useful results. I had to figure it all out by myself like in the good old pre-stackoverflow times...


I know is not a typical use case, as since almost all software use English for the C locale it hardly makes any sense to use fallback languages in practice if your main language is English. But theoretically it could happen, and providing an en translation is trivial.

Elephone P9000

by Leandro Lucarella on 2020- 11- 18 11:10 (updated on 2020- 11- 18 11:10)
tagged android, elephone, en, p9000, phone, review - with 0 comment(s)


This post is really old (May 2016), but was never published for some reason. I'm publishing it now just as an archeological artifact :)

I usually don't do reviews for anything, but I want to write a few points about this phone, in part for folks out there to know, but also as some sort of internal reminder of the things I've been finding.

I should say before anything else that I'm basically comparing this phone against my previous one, a Samsung Galaxy S4 (I9505) using CyanogenMod.

The Elephone P900 is a super tempting device. Here are the main reasons why I chosen this phone (in bold my hard requirements, in italics things I didn't really care about but it was a good opportunity to try out):

  • It has 4GB of RAM and fast CPU (octacore)
  • It supports memory expansion (micro SD up to 256GB 8-)
  • It has a very high screen to body ratio (about 83%, for comparison the Nexus 5 has 71% and the iPhone 5s has 61%). I was looking for a 5 inch phone, so to go for a 5.5 inch one, the overall size of the phone had to be as small as possible.
  • It has USB Type-C (I thought if I'm getting a new phone, better to have the new shiny no-non-sense connector)
  • It comes with Android 6 (I want either that or to be supported by CM)
  • Decent battery (3000mAh, which I expected to last for a full day of intensive use)
  • It has at least one "navigation button" (I don't want to lose part of my screen with software buttons)
  • It has a Sony camera sensor with f/2.0 and laser focus, which is supposed to be of decent quality really fast to do focus. That said, I read some reviews not speaking well about the camera
  • It has a rouged back (my S4 was a bit slippery)
  • It costs less than €250 (here in Germany)
  • It has wireless charging and quick charging
  • It has a fingerprint reader
  • It has a quite high-res frontal camera (8 megapixel)
  • It supports dual-SIM although the second SIM shares the slot with the memory expansion, so is not something I'll be able to use anyway

So, after using it for about a couple of days, these are my findings:

The good:

  • The build quality is very nice, it really looks like a high end phone. More than my old S4 (which is made of plastic, while the P9000 is metallic).
  • Is very light, even when it's a few grams extra compared to the S4, you can't really feel it. For offering 0.5 extra inches of screen is quite impressive.
  • It is fast. I wasn't expecting to notice a difference with the S4 really, basically because I don't feel the S4 is slow. But you can tell the difference. The P9000 is snappier.
  • It looks beautiful (at least for my minimalistic taste). I never care much about looks, but I really like this phone (much more than the S4).
  • Despite the big screen and feeling a bit too big at first, the size seems manageable and the extra screen space is useful.
  • Now having a fingerprint reader will probably be a requirement for my next phone. I encrypt my phone and use a longish password to unlock it. Being able to unlock it securely with just one touch is a huge gain.
  • It can be rooted. It took me a while to find the right flasher for Linux (you need the latest version of it), but I could do it, and even TWRP is available for it already, which gives me some hope about better ROMs, and maybe even CM, appearing in the future.

The Bad:

  • The fingerprint reader sucks. I've seen a video review complaining about it, and even for this guy complaining it worked much better than for me. I would say in my case it succeeds reading my fingerprint about less than 20% of the time. I even registered my fingerprint like five 5 times, using different finger positions and it still fails most of the time, and after 3 or 5 failures you have to wait 30 seconds before being able to retry.
  • The screen is not bright enough for a sunny day. You can still see the screen, but it's not as bright as the one in my old S4.
  • The camera pretty much sucks too. The f/2.0 I don't know where is it, pictures are always quite noisy. The auto-focus is not faster than my old S4. The sensor is supposed to be good, so I guess they just screwed it with the lenses. Or maybe is a firmware thing? But I doubt it.
  • The sound really SUCKS. I never thought about it before. Even when I listen to music a lot, I never had a good year and never could pick up on bad quality recordings for example. Is a blessing. But with this phone I noticed. It sounds like crap (and I'm not talking about the speaker, which is understandable, I'm talking about plugging earphones). When I noticed I thought it might be the album. I tried another one, and another one, and finally I compared the same files in my old S4 and... Oh boy. This new phone's audio just SUCKS SO BAD. It's the phone. I would say this was the final deal breaker for me.
  • The battery can't take an intense full day of usage. It's basically the same as my old S4 (and I want an improvement on this area). If I use it just for a few messages and most of the time inside with WiFi, it can last 2 full days. If I take it outside using mobile data, and listen to music during a hold day, it barely last for a day. If I add to that using maps and the GPS having the screen on more time, like when I'm traveling, it can barely last more than half a day.
  • The Android version is missing some features that I thought it was pure Android (not CM), like the Ambient Display (shows notifications in a dimmed screen), the LiveDisplay (adjust the screen color temperature according to the time of the day) and the Do Not Disturb mode(s). The keyboard doesn't support swiping (major drawback for me).
  • The touchscreen is not very sensitive. I can tell the difference with the S4. Maybe the one in the S4 is too sensitive, sometimes it reacts without even contacting the glass, but in the P9000 sometimes I feel I have to press the glass too much to get it reacting. Some gestures are harder to do because of this (like swipe-up to unlock).
  • Only one navigation button. Even when is better than nothing, I found much more convenient having 3 navigation buttons like the S4 provides.
  • No multicolor notification light. The navigation button on the bottom also serves as a notification light, but it has only one color and the frequency can't be configured either (AFAIK). The S4 has a multi-color led, which let you know what kind of notification is there before you even look at the screen.
  • USB Type-C is not popular enough yet. Even when this is not the phone's fault, I realized we are not there yet. Micro USB cables are everywhere out there. You'll never miss one. With Type-C you better carry your cable everywhere or buy a bunch, because you are all alone now.

So, even when the external quality is amazing and, even when I never cared about looks, it looks extremely nice too, it looks like the low price tag has to come from somewhere, and that somewhere is the internal components, which seems like they are not the best.

Still the quality-price ratio is quite impressive IMHO, on paper you have the same specs as an iPhone 6, or Samsung S7, at less than half the price. But I think I prefer to spend an extra few bucks to get higher internal components qualities (specially with the sound), so I will probably return this phone and continue looking for one. Also I miss my CM too much. I think I will have to settle for an older phone that's is supported by CM.


  • Fingerprint unlock and screen gestures makes the phone never enter deep sleep, nice features but until it's fixed it might be better to disable them, at least when you know you'll need some juice.
  • Fingerprint starts working better after some use (only 2 or 3 attempts are needed)
  • WiFi consumes more battery than mobile data (WTF!?)
  • RoDrIgUeZsTyLe™ MODPACK V1.1
    • Sound is saved (probably is not amazing, but I don't notice the obvious creepiness anymore). Praise the Lord!
    • Touchscreen is more sensitive, not as the S4 but definitely an appreciable improvement.
    • Battery life improved a lot. One day of moderate activity (for me) and still about 65% battery left. I used the phone for 12 hours after fully charged, and my usage pattern was: about 6 hours outside (using mobile data), about 40 minutes of music playing + GPS working in high accuracy mode. The rest inside using WiFi. I also did some messaging and internet use, but nothing too intensive. BetterBatteryStats reports: 66% (~8h) deep sleep (which is still low, I wonder what this phone could last if it were more aggressive about going to deep sleep), 8% (~1h) screen on. Wifi running 100% of the time (~12h). Battery consumption average was 3%/h. My guess is that with a similar usage, the S4 I would probably ended the day with not more than 30% or 40% battery.
  • Ways to improve the battery life and fix other stuff: Xposed framework, but not supported yet. For example with "Amplify Battery Extender" I could disable the wakelock for the fingerprint or NlpWakelock. Wakelock Terminator might also help (also needs Xposed)
  • For now using DisableService to disable NlpService from MTK NLP Service, the location seems to keep working fine. Another option is to put the GPS in device-only mode to avoid the NPL service from running.
  • Install Xposed using Eragon 2.0 ROM:
    1. Install Xposed Material installer (3.0 alpha4)
    2. Edit /etc/init.d/07permissive and comment out the sleep 60
    3. Install Xposed framework v82 (not a newer one otherwise settings will force close)
  • Battery life saved via update from 2016-05-31. Fingerprint reader and WiFi don't keep the phone awake anymore (5~10% awake when screen is off with both enabled).