Translatable string mystery

View: New views
11 Messages — Rating Filter:   Alert me  

Translatable string mystery

by Kummel62 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.

Hi,

When I was testing the filter problems i had, I found an untranslated string. But there was no such string in my sv.po! Started to search for it in the source files and found out that two almost identical code parts create different output to gramps.pot.

So in the source files the second lines for the description variable are treated different.

src/Filters/Rules/Note/_MatchesRegexpOf.py:

class MatchesRegexpOf(Rule):

labels = [ _('Regular expression:')]

name = _('Notes containing <regular expression>')

description = _("Matches notes who contain text "

"matching a regular expression")

category = _('General filters')

and

src/Filters/Rules/Note/_MatchesSubstringOf.py

class MatchesSubstringOf(Rule):

"""Notes having notes containing <subtring>"""

labels = [ _('Substring:')]

name = _('Notes containing <substring>')

description = _("Matches notes who contain text "

"matching a substring")

category = _('General filters')

In gramps.pot though the string "matching a substring" is not included

in #: ../src/Filters/Rules/Note/_MatchesRegexpOf.py:46????

#: ../src/Filters/Rules/Note/_MatchesSubstringOf.py:45

msgid "Notes containing <substring>"

msgstr ""

#: ../src/Filters/Rules/Note/_MatchesSubstringOf.py:46

msgid "Matches notes who contain text matching a substring"

msgstr ""

#: ../src/Filters/Rules/Note/_MatchesRegexpOf.py:45

msgid "Notes containing <regular expression>"

msgstr ""

#: ../src/Filters/Rules/Note/_MatchesRegexpOf.py:46

msgid "Matches notes who contain text "

msgstr ""

but it is in the source.

Can anyone come up with an hint of what's going on?

Or am I not seeing what I should see?

/Peter


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Gramps-devel mailing list
Gramps-devel@...
https://lists.sourceforge.net/lists/listinfo/gramps-devel

Re: Translatable string mystery

by Jerome :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> When I was testing the filter problems i had, I found an untranslated
> string. But there was no such string in my sv.po! Started to search for
> it in the source files and found out that two almost identical code
> parts create different output to gramps.pot.

True, references (src/Filters/Rules/Note/_MatchesRegexpOf.py,
src/Filters/Rules/Note/_MatchesSubstringOf.py) are not missing on
POTFILE.in !!!

Note, I do not know what is the difference *for users* between <RegExp>
and <substring> ? I thought 'Regexp' was only used on Sidebar filter
(but seems not !). There is few rules which are loaded
(/objects/__init__.py) but not used on filter editor (rules based on
regexp). They have translated strings but will not be displayed.
(invert !)

> but it is in the source.

Why an untranslated string ? I don't know ...




Peter Landgren a écrit :

>
>
> Hi,
>
> When I was testing the filter problems i had, I found an untranslated
> string. But there was no such string in my sv.po! Started to search for
> it in the source files and found out that two almost identical code
> parts create different output to gramps.pot.
>
> So in the source files the second lines for the description variable are
> treated different.
>
> src/Filters/Rules/Note/_MatchesRegexpOf.py:
>
> class MatchesRegexpOf(Rule):
>
> labels = [ _('Regular expression:')]
>
> name = _('Notes containing <regular expression>')
>
> description = _("Matches notes who contain text "
>
> "matching a regular expression")
>
> category = _('General filters')
>
> and
>
> src/Filters/Rules/Note/_MatchesSubstringOf.py
>
> class MatchesSubstringOf(Rule):
>
> """Notes having notes containing <subtring>"""
>
> labels = [ _('Substring:')]
>
> name = _('Notes containing <substring>')
>
> description = _("Matches notes who contain text "
>
> "matching a substring")
>
> category = _('General filters')
>
> In gramps.pot though the string "matching a substring" is not included
>
> in #: ../src/Filters/Rules/Note/_MatchesRegexpOf.py:46????
>
> #: ../src/Filters/Rules/Note/_MatchesSubstringOf.py:45
>
> msgid "Notes containing <substring>"
>
> msgstr ""
>
> #: ../src/Filters/Rules/Note/_MatchesSubstringOf.py:46
>
> msgid "Matches notes who contain text matching a substring"
>
> msgstr ""
>
> #: ../src/Filters/Rules/Note/_MatchesRegexpOf.py:45
>
> msgid "Notes containing <regular expression>"
>
> msgstr ""
>
> #: ../src/Filters/Rules/Note/_MatchesRegexpOf.py:46
>
> msgid "Matches notes who contain text "
>
> msgstr ""
>
> but it is in the source.
>
> Can anyone come up with an hint of what's going on?
>
> Or am I not seeing what I should see?
>
> /Peter
>
>
> ------------------------------------------------------------------------
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Gramps-devel mailing list
> Gramps-devel@...
> https://lists.sourceforge.net/lists/listinfo/gramps-devel



-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Gramps-devel mailing list
Gramps-devel@...
https://lists.sourceforge.net/lists/listinfo/gramps-devel

Re: Translatable string mystery

by Kummel62 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.

Den Monday 24 November 2008 13.07.15 skrev Jérôme:

> > When I was testing the filter problems i had, I found an untranslated

> > string. But there was no such string in my sv.po! Started to search for

> > it in the source files and found out that two almost identical code

> > parts create different output to gramps.pot.

>

> True, references (src/Filters/Rules/Note/_MatchesRegexpOf.py,

> src/Filters/Rules/Note/_MatchesSubstringOf.py) are not missing on

> POTFILE.in !!!

>

> Note, I do not know what is the difference *for users* between <RegExp>

> and <substring> ? I thought 'Regexp' was only used on Sidebar filter

> (but seems not !). There is few rules which are loaded

> (/objects/__init__.py) but not used on filter editor (rules based on

> regexp). They have translated strings but will not be displayed.

> (invert !)

I get the complete untranslated English string in the filter definitions GUI.

See picture for French!

/Peter



-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Gramps-devel mailing list
Gramps-devel@...
https://lists.sourceforge.net/lists/listinfo/gramps-devel

notessortfilterdef2.png (42K) Download Attachment

Re: Translatable string mystery

by Jerome :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Peter,


Yes, I see ...
  string for translation splitted into two strings !!!

on .po (or branch/gramps.pot line 17929) :

> #: ../src/Filters/Rules/Note/_MatchesRegexpOf.py:46
> msgid "Matches notes who contain text "
>  
> #: ../src/Filters/Rules/Note/_MatchesRegexpOf.py:46
> msgid "Matches notes who contain text "
> msgstr "Matchar anteckningar, som innehåller text "


-    description = _("Matches notes who contain text "
-                    "matching a regular expression")
+    description = _("Matches notes who contain text matching a regular
expression")

block issue (tab/space ?) or end of translated string "" ?

it is not (just an illustration) :
    description = _("Matches notes who contain text ")
                    _("matching a regular expression")



Jérôme


Peter Landgren a écrit :

>
>
> Den Monday 24 November 2008 13.07.15 skrev Jérôme:
>
>  > > When I was testing the filter problems i had, I found an untranslated
>
>  > > string. But there was no such string in my sv.po! Started to search for
>
>  > > it in the source files and found out that two almost identical code
>
>  > > parts create different output to gramps.pot.
>
>  >
>
>  > True, references (src/Filters/Rules/Note/_MatchesRegexpOf.py,
>
>  > src/Filters/Rules/Note/_MatchesSubstringOf.py) are not missing on
>
>  > POTFILE.in !!!
>
>  >
>
>  > Note, I do not know what is the difference *for users* between <RegExp>
>
>  > and <substring> ? I thought 'Regexp' was only used on Sidebar filter
>
>  > (but seems not !). There is few rules which are loaded
>
>  > (/objects/__init__.py) but not used on filter editor (rules based on
>
>  > regexp). They have translated strings but will not be displayed.
>
>  > (invert !)
>
> I get the complete untranslated English string in the filter definitions
> GUI.
>
> See picture for French!
>
> /Peter
>
>
> ------------------------------------------------------------------------
>



-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Gramps-devel mailing list
Gramps-devel@...
https://lists.sourceforge.net/lists/listinfo/gramps-devel

Re: Translatable string mystery

by Kummel62 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.

This type of code exists at 9 places and the POT-file catches 8 of these:

src\Filters\Rules\Source\_HasNoteRegexp.py]

Line 44 : "matching a regular expression")

src\Filters\Rules\_HasNoteRegexBase.py]

Line 47 : "matching a regular expression")

src\Filters\Rules\MediaObject\_HasNoteRegexp.py]

Line 45 : "matching a regular expression")

src\Filters\Rules\Place\_HasNoteRegexp.py]

Line 44 : "matching a regular expression")

src\Filters\Rules\Repository\_HasNoteRegexp.py]

Line 45 : "matching a regular expression")

src\Filters\Rules\Person\_HasNoteRegexp.py]

Line 44 : "matching a regular expression")

src\Filters\Rules\Note\_MatchesRegexpOf.py]

Line 47 : "matching a regular expression") <<< missed!

src\Filters\Rules\Family\_HasNoteRegexp.py]

Line 44 : "matching a regular expression")

src\Filters\Rules\Event\_HasNoteRegexp.py]

Line 44 : "matching a regular expression")

/Peter,

> Yes, I see ...

> string for translation splitted into two strings !!!

>

> on .po (or branch/gramps.pot line 17929) :

> > #: ../src/Filters/Rules/Note/_MatchesRegexpOf.py:46

> > msgid "Matches notes who contain text "

> >

> > #: ../src/Filters/Rules/Note/_MatchesRegexpOf.py:46

> > msgid "Matches notes who contain text "

> > msgstr "Matchar anteckningar, som innehåller text "

>

> - description = _("Matches notes who contain text "

> - "matching a regular expression")

> + description = _("Matches notes who contain text matching a regular

> expression")

>

> block issue (tab/space ?) or end of translated string "" ?

>

> it is not (just an illustration) :

> description = _("Matches notes who contain text ")

> _("matching a regular expression")

>

>

>

> Jérôme

>

> Peter Landgren a écrit :

> > Den Monday 24 November 2008 13.07.15 skrev Jérôme:

> > > > When I was testing the filter problems i had, I found an

> > > > untranslated

> > > >

> > > > string. But there was no such string in my sv.po! Started to search

> > > > for

> > > >

> > > > it in the source files and found out that two almost identical code

> > > >

> > > > parts create different output to gramps.pot.

> > >

> > > True, references (src/Filters/Rules/Note/_MatchesRegexpOf.py,

> > >

> > > src/Filters/Rules/Note/_MatchesSubstringOf.py) are not missing on

> > >

> > > POTFILE.in !!!

> > >

> > >

> > >

> > > Note, I do not know what is the difference *for users* between

> > > <RegExp>

> > >

> > > and <substring> ? I thought 'Regexp' was only used on Sidebar filter

> > >

> > > (but seems not !). There is few rules which are loaded

> > >

> > > (/objects/__init__.py) but not used on filter editor (rules based on

> > >

> > > regexp). They have translated strings but will not be displayed.

> > >

> > > (invert !)

> >

> > I get the complete untranslated English string in the filter definitions

> > GUI.

> >

> > See picture for French!

> >

> > /Peter

> >

> >

> > ------------------------------------------------------------------------

--

Peter Landgren

Talken Hagen

671 94 BRUNSKOG

0570-530 21

070-635 4719

peter.talken@...

Skype: pgl4820.2


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Gramps-devel mailing list
Gramps-devel@...
https://lists.sourceforge.net/lists/listinfo/gramps-devel

Re: Translatable string mystery

by Benny Malengier :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Very strange indeed.
I don't see difference, but pot file does...

in terminal:

python
>>> ("aaa"
... "bbb")
'aaabbb'
>>>  

So splitting lines should not be seen by the parser !

A bug somewhere, change the file to one line or split in another place, and see if generated pot file is then good I would say.

Benny

2008/11/24 Peter Landgren <peter.talken@...>

This type of code exists at 9 places and the POT-file catches 8 of these:

src\Filters\Rules\Source\_HasNoteRegexp.py]

Line 44 : "matching a regular expression")

src\Filters\Rules\_HasNoteRegexBase.py]

Line 47 : "matching a regular expression")

src\Filters\Rules\MediaObject\_HasNoteRegexp.py]

Line 45 : "matching a regular expression")

src\Filters\Rules\Place\_HasNoteRegexp.py]

Line 44 : "matching a regular expression")

src\Filters\Rules\Repository\_HasNoteRegexp.py]

Line 45 : "matching a regular expression")

src\Filters\Rules\Person\_HasNoteRegexp.py]

Line 44 : "matching a regular expression")

src\Filters\Rules\Note\_MatchesRegexpOf.py]

Line 47 : "matching a regular expression") <<< missed!

src\Filters\Rules\Family\_HasNoteRegexp.py]

Line 44 : "matching a regular expression")

src\Filters\Rules\Event\_HasNoteRegexp.py]

Line 44 : "matching a regular expression")

/Peter,

> Yes, I see ...

> string for translation splitted into two strings !!!

>

> on .po (or branch/gramps.pot line 17929) :

> > #: ../src/Filters/Rules/Note/_MatchesRegexpOf.py:46

> > msgid "Matches notes who contain text "

> >

> > #: ../src/Filters/Rules/Note/_MatchesRegexpOf.py:46

> > msgid "Matches notes who contain text "

> > msgstr "Matchar anteckningar, som innehåller text "

>

> - description = _("Matches notes who contain text "

> - "matching a regular expression")

> + description = _("Matches notes who contain text matching a regular

> expression")

>

> block issue (tab/space ?) or end of translated string "" ?

>

> it is not (just an illustration) :

> description = _("Matches notes who contain text ")

> _("matching a regular expression")

>

>

>

> Jérôme

>

> Peter Landgren a écrit :

> > Den Monday 24 November 2008 13.07.15 skrev Jérôme:

> > > > When I was testing the filter problems i had, I found an

> > > > untranslated

> > > >

> > > > string. But there was no such string in my sv.po! Started to search

> > > > for

> > > >

> > > > it in the source files and found out that two almost identical code

> > > >

> > > > parts create different output to gramps.pot.

> > >

> > > True, references (src/Filters/Rules/Note/_MatchesRegexpOf.py,

> > >

> > > src/Filters/Rules/Note/_MatchesSubstringOf.py) are not missing on

> > >

> > > POTFILE.in !!!

> > >

> > >

> > >

> > > Note, I do not know what is the difference *for users* between

> > > <RegExp>

> > >

> > > and <substring> ? I thought 'Regexp' was only used on Sidebar filter

> > >

> > > (but seems not !). There is few rules which are loaded

> > >

> > > (/objects/__init__.py) but not used on filter editor (rules based on

> > >

> > > regexp). They have translated strings but will not be displayed.

> > >

> > > (invert !)

> >

> > I get the complete untranslated English string in the filter definitions

> > GUI.

> >

> > See picture for French!

> >

> > /Peter

> >

> >

> > ------------------------------------------------------------------------

--

Peter Landgren

Talken Hagen

671 94 BRUNSKOG

0570-530 21

070-635 4719

peter.talken@...

Skype: pgl4820.2


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Gramps-devel mailing list
Gramps-devel@...
https://lists.sourceforge.net/lists/listinfo/gramps-devel



-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Gramps-devel mailing list
Gramps-devel@...
https://lists.sourceforge.net/lists/listinfo/gramps-devel

Re: Translatable string mystery

by Kummel62 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.

This is what I did:

1. Changed so that the two strings were on the same line

Now new complete string shows up! OK

2. Did undo of the above.

Only partial string is shown now.

3. Looked with hex editor and found that the file probably had been edited

in Windows as there were CR+LF all over the file.

4. In the hexeditor replaced CR+LF with LF.

Now new complete string shows up! OK

So, the question is now:

Does this happens in other files, which have CR+LF so that we might have other incomplete strings in the pot file?

I'm not good at regular expressions, but is there a method to scan all *.py files looking for 0x0d0a?

/Peter

PS

The same error occurs both in branch and trunk.

> Very strange indeed.

> I don't see difference, but pot file does...

>

> in terminal:

>

> python

>

> >>> ("aaa"

>

> ... "bbb")

> 'aaabbb'

>

>

> So splitting lines should not be seen by the parser !

>

> A bug somewhere, change the file to one line or split in another place, and

> see if generated pot file is then good I would say.

>

> Benny

>

> 2008/11/24 Peter Landgren <peter.talken@...>

>

> > This type of code exists at 9 places and the POT-file catches 8 of

> > these:

> >

> > src\Filters\Rules\Source\_HasNoteRegexp.py]

> >

> > Line 44 : "matching a regular expression")

> >

> > src\Filters\Rules\_HasNoteRegexBase.py]

> >

> > Line 47 : "matching a regular expression")

> >

> > src\Filters\Rules\MediaObject\_HasNoteRegexp.py]

> >

> > Line 45 : "matching a regular expression")

> >

> > src\Filters\Rules\Place\_HasNoteRegexp.py]

> >

> > Line 44 : "matching a regular expression")

> >

> > src\Filters\Rules\Repository\_HasNoteRegexp.py]

> >

> > Line 45 : "matching a regular expression")

> >

> > src\Filters\Rules\Person\_HasNoteRegexp.py]

> >

> > Line 44 : "matching a regular expression")

> >

> > src\Filters\Rules\Note\_MatchesRegexpOf.py]

> >

> > Line 47 : "matching a regular expression") <<< missed!

> >

> > src\Filters\Rules\Family\_HasNoteRegexp.py]

> >

> > Line 44 : "matching a regular expression")

> >

> > src\Filters\Rules\Event\_HasNoteRegexp.py]

> >

> > Line 44 : "matching a regular expression")

> >

> > /Peter,

> >

> > > Yes, I see ...

> > >

> > > string for translation splitted into two strings !!!

> > >

> > > on .po (or branch/gramps.pot line 17929) :

> > > > #: ../src/Filters/Rules/Note/_MatchesRegexpOf.py:46

> > > >

> > > > msgid "Matches notes who contain text "

> > > >

> > > >

> > > >

> > > > #: ../src/Filters/Rules/Note/_MatchesRegexpOf.py:46

> > > >

> > > > msgid "Matches notes who contain text "

> > > >

> > > > msgstr "Matchar anteckningar, som innehåller text "

> > >

> > > - description = _("Matches notes who contain text "

> > >

> > > - "matching a regular expression")

> > >

> > > + description = _("Matches notes who contain text matching a regular

> > >

> > > expression")

> > >

> > >

> > >

> > > block issue (tab/space ?) or end of translated string "" ?

> > >

> > >

> > >

> > > it is not (just an illustration) :

> > >

> > > description = _("Matches notes who contain text ")

> > >

> > > _("matching a regular expression")

> > >

> > >

> > >

> > >

> > >

> > >

> > >

> > > Jérôme

> > >

> > > Peter Landgren a écrit :

> > > > Den Monday 24 November 2008 13.07.15 skrev Jérôme:

> > > > > > When I was testing the filter problems i had, I found an

> > > > > >

> > > > > > untranslated

> > > > > >

> > > > > >

> > > > > >

> > > > > > string. But there was no such string in my sv.po! Started to

> > > > > > search

> > > > > >

> > > > > > for

> > > > > >

> > > > > >

> > > > > >

> > > > > > it in the source files and found out that two almost identical

> > > > > > code

> > > > > >

> > > > > >

> > > > > >

> > > > > > parts create different output to gramps.pot.

> > > > >

> > > > > True, references (src/Filters/Rules/Note/_MatchesRegexpOf.py,

> > > > >

> > > > >

> > > > >

> > > > > src/Filters/Rules/Note/_MatchesSubstringOf.py) are not missing on

> > > > >

> > > > >

> > > > >

> > > > > POTFILE.in !!!

> > > > >

> > > > >

> > > > >

> > > > >

> > > > >

> > > > >

> > > > >

> > > > > Note, I do not know what is the difference *for users* between

> > > > >

> > > > > <RegExp>

> > > > >

> > > > >

> > > > >

> > > > > and <substring> ? I thought 'Regexp' was only used on Sidebar

> > > > > filter

> > > > >

> > > > >

> > > > >

> > > > > (but seems not !). There is few rules which are loaded

> > > > >

> > > > >

> > > > >

> > > > > (/objects/__init__.py) but not used on filter editor (rules based

> > > > > on

> > > > >

> > > > >

> > > > >

> > > > > regexp). They have translated strings but will not be displayed.

> > > > >

> > > > >

> > > > >

> > > > > (invert !)

> > > >

> > > > I get the complete untranslated English string in the filter

> >

> > definitions

> >

> > > > GUI.

> > > >

> > > >

> > > >

> > > > See picture for French!

> > > >

> > > >

> > > >

> > > > /Peter

> >

> > ------------------------------------------------------------------------

> >

> > --

> >

> > Peter Landgren

> >

> > Talken Hagen

> >

> > 671 94 BRUNSKOG

> >

> > 0570-530 21

> >

> > 070-635 4719

> >

> > peter.talken@...

> >

> > Skype: pgl4820.2

> >

> >

> > -------------------------------------------------------------------------

> > This SF.Net email is sponsored by the Moblin Your Move Developer's

> > challenge

> > Build the coolest Linux based applications with Moblin SDK & win great

> > prizes

> > Grand prize is a trip for two to an Open Source event anywhere in the

> > world http://moblin-contest.org/redirect.php?banner_id=100&url=/

> > _______________________________________________

> > Gramps-devel mailing list

> > Gramps-devel@...

> > https://lists.sourceforge.net/lists/listinfo/gramps-devel

--

Peter Landgren

Talken Hagen

671 94 BRUNSKOG

0570-530 21

070-635 4719

peter.talken@...

Skype: pgl4820.2


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Gramps-devel mailing list
Gramps-devel@...
https://lists.sourceforge.net/lists/listinfo/gramps-devel

Re: Translatable string mystery

by Kummel62 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.

Den Monday 24 November 2008 17.49.58 skrev Peter Landgren:

> This is what I did:

> 1. Changed so that the two strings were on the same line

> Now new complete string shows up! OK

> 2. Did undo of the above.

> Only partial string is shown now.

> 3. Looked with hex editor and found that the file probably had been edited

> in Windows as there were CR+LF all over the file.

> 4. In the hexeditor replaced CR+LF with LF.

> Now new complete string shows up! OK

>

> So, the question is now:

> Does this happens in other files, which have CR+LF so that we might have

> other incomplete strings in the pot file?

I answer my own question. I found only one file src\Filters\Rules\Note\_MatchesRegexpOf.py

that used CR+LF. (There was also a CR+LF in a comment in one file.)

See

http://www.gramps-project.org/bugs/view.php?id=2515

I have only updated the s_MatchesRegexpOf.py, gramps.pot and sv.po.

but not the other *.po files.

Shall I do this too, or it might be better to note the translators about this?

/Peter


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Gramps-devel mailing list
Gramps-devel@...
https://lists.sourceforge.net/lists/listinfo/gramps-devel

Re: Translatable string mystery

by Benny Malengier :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Brian, is there no subversion option to make this impossible? I remember something like that but believe subversion is a specialty of you ;-)
We can hardly forbid the use of windows in developping.

Peter, good work to use a Hex editor! How paranoid of you.
I would let the other languages fix the translation, nothing changes, it did not translate at the moment, and I don't think you know all languages GRAMPS is translated in. This string will be flagged fuzzy anyway, no.

Benny

2008/11/24 Peter Landgren <peter.talken@...>

This is what I did:

1. Changed so that the two strings were on the same line

Now new complete string shows up! OK

2. Did undo of the above.

Only partial string is shown now.

3. Looked with hex editor and found that the file probably had been edited

in Windows as there were CR+LF all over the file.

4. In the hexeditor replaced CR+LF with LF.

Now new complete string shows up! OK

So, the question is now:

Does this happens in other files, which have CR+LF so that we might have other incomplete strings in the pot file?

I'm not good at regular expressions, but is there a method to scan all *.py files looking for 0x0d0a?

/Peter

PS

The same error occurs both in branch and trunk.

> Very strange indeed.

> I don't see difference, but pot file does...

>

> in terminal:

>

> python

>

> >>> ("aaa"

>

> ... "bbb")

> 'aaabbb'

>

>

> So splitting lines should not be seen by the parser !

>

> A bug somewhere, change the file to one line or split in another place, and

> see if generated pot file is then good I would say.

>

> Benny

>

> 2008/11/24 Peter Landgren <peter.talken@...>

>

> > This type of code exists at 9 places and the POT-file catches 8 of

> > these:

> >

> > src\Filters\Rules\Source\_HasNoteRegexp.py]

> >

> > Line 44 : "matching a regular expression")

> >

> > src\Filters\Rules\_HasNoteRegexBase.py]

> >

> > Line 47 : "matching a regular expression")

> >

> > src\Filters\Rules\MediaObject\_HasNoteRegexp.py]

> >

> > Line 45 : "matching a regular expression")

> >

> > src\Filters\Rules\Place\_HasNoteRegexp.py]

> >

> > Line 44 : "matching a regular expression")

> >

> > src\Filters\Rules\Repository\_HasNoteRegexp.py]

> >

> > Line 45 : "matching a regular expression")

> >

> > src\Filters\Rules\Person\_HasNoteRegexp.py]

> >

> > Line 44 : "matching a regular expression")

> >

> > src\Filters\Rules\Note\_MatchesRegexpOf.py]

> >

> > Line 47 : "matching a regular expression") <<< missed!

> >

> > src\Filters\Rules\Family\_HasNoteRegexp.py]

> >

> > Line 44 : "matching a regular expression")

> >

> > src\Filters\Rules\Event\_HasNoteRegexp.py]

> >

> > Line 44 : "matching a regular expression")

> >

> > /Peter,

> >

> > > Yes, I see ...

> > >

> > > string for translation splitted into two strings !!!

> > >

> > > on .po (or branch/gramps.pot line 17929) :

> > > > #: ../src/Filters/Rules/Note/_MatchesRegexpOf.py:46

> > > >

> > > > msgid "Matches notes who contain text "

> > > >

> > > >

> > > >

> > > > #: ../src/Filters/Rules/Note/_MatchesRegexpOf.py:46

> > > >

> > > > msgid "Matches notes who contain text "

> > > >

> > > > msgstr "Matchar anteckningar, som innehåller text "

> > >

> > > - description = _("Matches notes who contain text "

> > >

> > > - "matching a regular expression")

> > >

> > > + description = _("Matches notes who contain text matching a regular

> > >

> > > expression")

> > >

> > >

> > >

> > > block issue (tab/space ?) or end of translated string "" ?

> > >

> > >

> > >

> > > it is not (just an illustration) :

> > >

> > > description = _("Matches notes who contain text ")

> > >

> > > _("matching a regular expression")

> > >

> > >

> > >

> > >

> > >

> > >

> > >

> > > Jérôme

> > >

> > > Peter Landgren a écrit :

> > > > Den Monday 24 November 2008 13.07.15 skrev Jérôme:

> > > > > > When I was testing the filter problems i had, I found an

> > > > > >

> > > > > > untranslated

> > > > > >

> > > > > >

> > > > > >

> > > > > > string. But there was no such string in my sv.po! Started to

> > > > > > search

> > > > > >

> > > > > > for

> > > > > >

> > > > > >

> > > > > >

> > > > > > it in the source files and found out that two almost identical

> > > > > > code

> > > > > >

> > > > > >

> > > > > >

> > > > > > parts create different output to gramps.pot.

> > > > >

> > > > > True, references (src/Filters/Rules/Note/_MatchesRegexpOf.py,

> > > > >

> > > > >

> > > > >

> > > > > src/Filters/Rules/Note/_MatchesSubstringOf.py) are not missing on

> > > > >

> > > > >

> > > > >

> > > > > POTFILE.in !!!

> > > > >

> > > > >

> > > > >

> > > > >

> > > > >

> > > > >

> > > > >

> > > > > Note, I do not know what is the difference *for users* between

> > > > >

> > > > > <RegExp>

> > > > >

> > > > >

> > > > >

> > > > > and <substring> ? I thought 'Regexp' was only used on Sidebar

> > > > > filter

> > > > >

> > > > >

> > > > >

> > > > > (but seems not !). There is few rules which are loaded

> > > > >

> > > > >

> > > > >

> > > > > (/objects/__init__.py) but not used on filter editor (rules based

> > > > > on

> > > > >

> > > > >

> > > > >

> > > > > regexp). They have translated strings but will not be displayed.

> > > > >

> > > > >

> > > > >

> > > > > (invert !)

> > > >

> > > > I get the complete untranslated English string in the filter

> >

> > definitions

> >

> > > > GUI.

> > > >

> > > >

> > > >

> > > > See picture for French!

> > > >

> > > >

> > > >

> > > > /Peter

> >

> > ------------------------------------------------------------------------

> >

> > --

> >

> > Peter Landgren

> >

> > Talken Hagen

> >

> > 671 94 BRUNSKOG

> >

> > 0570-530 21

> >

> > 070-635 4719

> >

> > peter.talken@...

> >

> > Skype: pgl4820.2

> >

> >

> > -------------------------------------------------------------------------

> > This SF.Net email is sponsored by the Moblin Your Move Developer's

> > challenge

> > Build the coolest Linux based applications with Moblin SDK & win great

> > prizes

> > Grand prize is a trip for two to an Open Source event anywhere in the

> > world http://moblin-contest.org/redirect.php?banner_id=100&url=/

> > _______________________________________________

> > Gramps-devel mailing list

> > Gramps-devel@...

> > https://lists.sourceforge.net/lists/listinfo/gramps-devel

--

Peter Landgren

Talken Hagen

671 94 BRUNSKOG

0570-530 21

070-635 4719

peter.talken@...

Skype: pgl4820.2



-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Gramps-devel mailing list
Gramps-devel@...
https://lists.sourceforge.net/lists/listinfo/gramps-devel

Re: Translatable string mystery

by Stéphane Charette-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Mon, Nov 24, 2008 at 13:35, Benny Malengier
<benny.malengier@...> wrote:
> Brian, is there no subversion option to make this impossible? I remember
> something like that but believe subversion is a specialty of you ;-)
> We can hardly forbid the use of windows in developping.

There is a subversion propset that tells svn what kind of end-of-line
processing you want it to use.

No process, convert to local host ("native"), force CR, force LF, force CRLF.

(Did I miss one?)

The propset is called svn:eol-style.  For example, try running:

    svn -v proplist *.py

(I'm not at my computer with GRAMPS/SVN, but I think that is correct.)

So if we tell svn to use "native", the next time you check out (or
check in?) the file I believe it will go through and fix all eol in
the file to match the native OS-specific method typically used to
indicate end-of-line.  This way you wont have files with a mix of
CRLF, CR, and LF, which is probably what caused the confusion in this
case.

This property has to be set "per file".  There is no global setting as
far as I remember, and the setting is not local to your dev
environment but is stored as meta-data in the svn database.

Stéphane

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Gramps-devel mailing list
Gramps-devel@...
https://lists.sourceforge.net/lists/listinfo/gramps-devel

Re: Translatable string mystery

by Kees Bakker :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Monday 24 November 2008, Peter Landgren wrote:

> Den Monday 24 November 2008 17.49.58 skrev Peter Landgren:
> > This is what I did:
> > 1. Changed so that the two strings were on the same line
> >     Now new complete string shows up! OK
> > 2. Did undo of the above.
> >    Only partial string is shown now.
> > 3. Looked with hex editor and found that the file probably had been edited
> >     in Windows as there were CR+LF all over the file.
> > 4. In the hexeditor replaced CR+LF with LF.
> >     Now new complete string shows up! OK
> >
> > So, the question is now:
> > Does this happens in other files, which have CR+LF so that we might have
> > other incomplete strings in the pot file?
>
> I answer my own question. I found only one file src\Filters\Rules\Note\_MatchesRegexpOf.py
> that used CR+LF. (There was also a CR+LF in a comment in one file.)
> See
> http://www.gramps-project.org/bugs/view.php?id=2515
Maybe a little late for this investigation. Here is a small utility in Python
to analyse the eol mode of files. In the default mode it only reports conflicting
eol modes (mix of LF and CRLF), and it reports a missing eol at the end of the file.
If you use --report-crlf it reports files with CRLF.

OK. This is what I did a moment ago:
   find . -name '*.py' -exec eol-mode '{}' \;

./src/ReportBase/_Bibliography.py:      last line no EOL
./src/Editors/_EditPrimary.py:  last line no EOL
./src/widgets/toolcomboentry.py:        last line no EOL
./src/widgets/valueaction.py:   last line no EOL
./src/plugins/ImportCsv.py:     last line no EOL
./src/plugins/ExportCsv.py:     last line no EOL
./src/plugins/ExportVCalendar.py:       last line no EOL
./src/plugins/ImportGedcom.py:  last line no EOL
./src/plugins/ExportGeneWeb.py: last line no EOL
./src/plugins/Reporef.py:       Mixed LF and CRLF
./src/plugins/ExportPkg.py:     last line no EOL
./src/plugins/ImportXml.py:     last line no EOL
./src/plugins/ExportXml.py:     last line no EOL
./src/docgen/__init__.py:       last line no EOL
./src/docgen/PdfDoc.py: last line no EOL
./src/gen/lib/styledtext.py:    last line no EOL
./src/gen/plug/_plugin.py:      last line no EOL
./src/gen/plug/_export.py:      last line no EOL

If you rerun this with --report-crlf you get all the files
with CRLF eol.
--
Kees


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Gramps-devel mailing list
Gramps-devel@...
https://lists.sourceforge.net/lists/listinfo/gramps-devel

eol-mode (2K) Download Attachment