Re: Finding strings in GNOME

2021-05-09 Thread Yuri Chornoivan via gnome-i18n
понеділок, 10 травня 2021 р. 03:16:59 EEST scootergrisen via gnome-i18n 
написано:
> Den 09-05-2021 kl. 23:21 skrev Daniel Șerbănescu:
> > În data de Du, 09-05-2021 la 22:37 +0200, Matej Urban via gnome-i18n a
> > 
> > scris:
> >> Hello, I need a bit of help.
> >> I frequently see strange translations, but then can not find, which
> >> packet those belong to. Is there a simple way to find them?
> > 
> > Hello Matej,
> > Here are the steps I usually do:
> > 1. On your language team page in Damned Lies open a release page (Like
> > Gnome 40). There is a link to download all the .po files, it is located
> > at the bottom of translation statistics. So click that link to download
> > E.g. For the Romanian team the link would be at the bottom os this page:
> > https://l10n.gnome.org/languages/ro/gnome-40/ui/
> > 
> > 2. Extract the .po files in a folder
> > 3. Open a terminal in that folder
> > 4. Use the following grep command: grep -ri "the string you are looking
> > for" *
> > (replace "the string you are looking for" with the actual search term.)
> > 
> > Be aware that there can be memonics in the original string so you could
> > try searching for a part of that string.
> 
> Do anyone know how to ignore these "_" memonics that might be in strings?
> 
> So i can search for "Test" and i will find all these:
> "Test"
> "_Test"
> "T_est"
> "Te_st"
> "Tes_t"

Hi,

You can use something like this (search.sh):
-
#!/bin/bash 

for i in `find /usr/share/locale/da/LC_MESSAGES -name '*.mo'`
do
sed "s/[&_]//g"<$i|if grep -q $1 "$i"; then echo $i; fi
done
-
then

./search.sh Test

Hope this helps.

Best regards,
Yuri


___
gnome-i18n mailing list
gnome-i18n@gnome.org
https://mail.gnome.org/mailman/listinfo/gnome-i18n


Re: Finding strings in GNOME

2021-05-09 Thread Matej Urban via gnome-i18n
Daniel than you for your reply.
GNOME files are not the problem. I have a complete control over those, I'm
obviously looking for strings that come from other packages. I find a lot
of them in freedesktop.org, many times also in TP-Project. But searching
takes time.

There used to be a PPA for ubuntu *ubuntu-translations-**coordi**nators*
that included *ubuntu-l10n-tool*, a package that did right that, but it is
unactive for years.

I'm sure there is a way to search in e.g. .mo files on my sistem. If I find
that file, I know, where the string is.
Best,
Matej

On Mon, May 10, 2021 at 2:17 AM scootergrisen via gnome-i18n <
gnome-i18n@gnome.org> wrote:

> Den 09-05-2021 kl. 23:21 skrev Daniel Șerbănescu:
> > În data de Du, 09-05-2021 la 22:37 +0200, Matej Urban via gnome-i18n a
> > scris:
> >> Hello, I need a bit of help.
> >> I frequently see strange translations, but then can not find, which
> >> packet those belong to. Is there a simple way to find them?
> >
> > Hello Matej,
> > Here are the steps I usually do:
> > 1. On your language team page in Damned Lies open a release page (Like
> > Gnome 40). There is a link to download all the .po files, it is located
> > at the bottom of translation statistics. So click that link to download
> > E.g. For the Romanian team the link would be at the bottom os this page:
> > https://l10n.gnome.org/languages/ro/gnome-40/ui/
> > 
> > 2. Extract the .po files in a folder
> > 3. Open a terminal in that folder
> > 4. Use the following grep command: grep -ri "the string you are looking
> > for" *
> > (replace "the string you are looking for" with the actual search term.)
> >
> > Be aware that there can be memonics in the original string so you could
> > try searching for a part of that string.
>
> Do anyone know how to ignore these "_" memonics that might be in strings?
>
> So i can search for "Test" and i will find all these:
> "Test"
> "_Test"
> "T_est"
> "Te_st"
> "Tes_t"
> ___
> gnome-i18n mailing list
> gnome-i18n@gnome.org
> https://mail.gnome.org/mailman/listinfo/gnome-i18n
>
___
gnome-i18n mailing list
gnome-i18n@gnome.org
https://mail.gnome.org/mailman/listinfo/gnome-i18n


Re: Finding strings in GNOME

2021-05-09 Thread scootergrisen via gnome-i18n

Den 09-05-2021 kl. 23:21 skrev Daniel Șerbănescu:
În data de Du, 09-05-2021 la 22:37 +0200, Matej Urban via gnome-i18n a 
scris:

Hello, I need a bit of help.
I frequently see strange translations, but then can not find, which 
packet those belong to. Is there a simple way to find them?


Hello Matej,
Here are the steps I usually do:
1. On your language team page in Damned Lies open a release page (Like 
Gnome 40). There is a link to download all the .po files, it is located 
at the bottom of translation statistics. So click that link to download
E.g. For the Romanian team the link would be at the bottom os this page: 
https://l10n.gnome.org/languages/ro/gnome-40/ui/ 


2. Extract the .po files in a folder
3. Open a terminal in that folder
4. Use the following grep command: grep -ri "the string you are looking 
for" *

(replace "the string you are looking for" with the actual search term.)

Be aware that there can be memonics in the original string so you could 
try searching for a part of that string.


Do anyone know how to ignore these "_" memonics that might be in strings?

So i can search for "Test" and i will find all these:
"Test"
"_Test"
"T_est"
"Te_st"
"Tes_t"
___
gnome-i18n mailing list
gnome-i18n@gnome.org
https://mail.gnome.org/mailman/listinfo/gnome-i18n


Re: Finding strings in GNOME

2021-05-09 Thread Daniel Șerbănescu
În data de Du, 09-05-2021 la 22:37 +0200, Matej Urban via gnome-i18n a
scris:
> Hello, I need a bit of help.
> I frequently see strange translations, but then can not find, which
> packet those belong to. Is there a simple way to find them?

Hello Matej,
Here are the steps I usually do:
1. On your language team page in Damned Lies open a release page (Like
Gnome 40). There is a link to download all the .po files, it is located
at the bottom of translation statistics. So click that link to download
E.g. For the Romanian team the link would be at the bottom os this
page: https://l10n.gnome.org/languages/ro/gnome-40/ui/
2. Extract the .po files in a folder
3. Open a terminal in that folder
4. Use the following grep command: grep -ri "the string you are looking
for" *
(replace "the string you are looking for" with the actual search term.)

Be aware that there can be memonics in the original string so you could
try searching for a part of that string.

Hope it helps you... There might be other ways to do it... maybe via
Gitlab, but I don't know other ways. 

Regards Daniel
___
gnome-i18n mailing list
gnome-i18n@gnome.org
https://mail.gnome.org/mailman/listinfo/gnome-i18n


Rounding numbers in locale friendly way

2021-05-09 Thread Marcus Lundblad
Hi!

In Maps we display population numbers in the place bubbles (typically
for places like towns, cities, states and so on) based on the
"population" tag from the OpenStreetMap database.

In a some cases, where population numbers are more like estimates, this
number can be rounded, say to the nearest 100k.

Currenly we display the number just a normal integer, using the user's
locale.

So, in a cases, where let's say a city is tagged population=120

it would be displayed: 1,200,000 in English (and so on, 1 200 000 e.g.
in Swedish).

I have played with the idea to try to "detect" when it's an estimate.

For example, something like:

if population "an even multiple of 100":

display _("%s M") where %s is population / 100 with one significant
digit.

if population > 100 and "an even mulitple of 10"

display _("%s M") where %s is population / 100 with two significant
digits (e.g. one decimal digit).

otherwise just display the number locale-formatted (like is done
today).

Does this make sense? Or would this assumption that millions "M" is an
appropriate concept cause trouble in some languages?

I guess the these would also be using ngettext (with the even muliples
of one million as "n".

//Marcus

___
gnome-i18n mailing list
gnome-i18n@gnome.org
https://mail.gnome.org/mailman/listinfo/gnome-i18n


Finding strings in GNOME

2021-05-09 Thread Matej Urban via gnome-i18n
Hello, I need a bit of help.
I frequently see strange translations, but then can not find, which packet
those belong to. Is there a simple way to find them?

Thanks,
Matej
___
gnome-i18n mailing list
gnome-i18n@gnome.org
https://mail.gnome.org/mailman/listinfo/gnome-i18n