Display Name Editor - Given name bug?

classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Display Name Editor - Given name bug?

Bernard Banko-2
Hello,
Can you check for me if you get everything ok when defining this combination:
Given Surname (Familynick Call)

I am not sure if this is my translation issue or is it in another languages, too.
By the way, GIVEN SURNAME (Familynick Call) works as expected.

Thanks.
PS: in such combinations the () should also be omitted when both names empty

Regards,
Bernard.

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Gramps-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Display Name Editor - Given name bug?

Paul Franklin-5
I don't use the name editor so I am hardly an expert, but
I am wondering what you are saying is a problem?

When I tried both your new formats, in the name editor
the "example name" showed what I assume are the correct
values (although I have no way to know).

In the (non-tree) People view, when I loaded example.gramps
in, the main person (I0044) seemed to show both the Call and
Familynick names in the parentheses, whether or not the
surname and given name were asked to be in capitals.

I do wonder, however, how the "Familynick" name is ever set,
since I didn't see a field for that in the person editor (for I0044)?

So I am wondering if you are saying that all the other names,
the ones with no Familynick or Call names, should /not/ be
showing the empty parentheses -- "(  )" that I saw?

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Gramps-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Display Name Editor - Given name bug?

Paul Franklin-5
Perhaps I should mention I used "master" for my test.

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Gramps-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Display Name Editor - Given name bug?

Paul Franklin-5
In reply to this post by Bernard Banko-2
On 2/5/17, Bernard <[hidden email]> wrote:
> If this is slovene only, could the reason be that in slovene the word Given
> (ime) is contained in the word Surname (pri*ime*k)?

Well, I'd guess you could test that, by temporarily
changing the translation for one or the other (as
long as you did whatever you do to write out the
binary also).

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Gramps-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Display Name Editor - Given name bug?

Bernard Banko-2
Great idea.
Sloveninan string looks in english locale like this: Name|Primary Surname Familynick Name|Call !
When I put it in english locale as Given Surname Familynick Call, I get it back in slovenian as Ime Priimek Hišno Call.
I need to dig deep in that sl.po file.

Does any other locale behave like this?


On Mon, Feb 6, 2017 at 12:07 AM, Paul Franklin <[hidden email]> wrote:
On 2/5/17, Bernard <[hidden email]> wrote:
> If this is slovene only, could the reason be that in slovene the word Given
> (ime) is contained in the word Surname (pri*ime*k)?

Well, I'd guess you could test that, by temporarily
changing the translation for one or the other (as
long as you did whatever you do to write out the
binary also).


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Gramps-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Display Name Editor - Given name bug?

prculley
> If this is slovene only, could the reason be that in slovene the word Given
> (ime) is contained in the word Surname (pri*ime*k)?

This is the issue.  Gramps is using some fairly nasty regular expressions to convert the name editor expressions to display format codes.  Apparently the 'ime' is found before the 'priimek' and takes precedence.
The simplest fix (if possible) would be to find a synonym for one of these words to use in the name editor translation, so there would be no ambiguity.
Otherwise, someone who understand regular expressions will have to figure out a way to select the largest possible match, rather than the first match.

The empty parenthesis are because it contains two name segments, and a space.  Again it would take special code to detect situations like this, possible but a separate bug/enhancement request.

Paul Culley

On Sun, Feb 5, 2017 at 5:37 PM, Bernard <[hidden email]> wrote:
Great idea.
Sloveninan string looks in english locale like this: Name|Primary Surname Familynick Name|Call !
When I put it in english locale as Given Surname Familynick Call, I get it back in slovenian as Ime Priimek Hišno Call.
I need to dig deep in that sl.po file.

Does any other locale behave like this?


On Mon, Feb 6, 2017 at 12:07 AM, Paul Franklin <[hidden email]> wrote:
On 2/5/17, Bernard <[hidden email]> wrote:
> If this is slovene only, could the reason be that in slovene the word Given
> (ime) is contained in the word Surname (pri*ime*k)?

Well, I'd guess you could test that, by temporarily
changing the translation for one or the other (as
long as you did whatever you do to write out the
binary also).



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Gramps-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Display Name Editor - Given name bug?

Paul Franklin-5
> Otherwise, someone who understand regular expressions will have to figure
> out a way to select the largest possible match, rather than the first match.

Well, one common way to search for a pattern which might be
a subset of other patterns is to "anchor" the pattern you
are searching for.  This is done by attaching a character to
at least one end of the pattern and typically at both ends,
a character which you know (somehow) will not be in any of
the strings you are searching.

Let's say you know that the character "space" -- " " -- will
not be in any string.  Let's further say you know that the
strings are in a longer string with space delimiters, say

"aaa bbb ccc aaabbbccc"

So the first thing to do is to attach a space on each end:

" aaa bbb ccc aaabbbccc "

Then when you search that string (using a r.e.) you just
attach a space to each end of the string you are looking
for.  Thus " aaa " or " bbb " or " ccc " or " aaabbbccc "
are all unique strings, when the longer string is checked.

It's only slightly different if a "space" character could be
part of the string you want to find.  You then have to add a
different character as the anchor, but again one which you
somehow know will never be a character in anything you are
searching for.

Perhaps a percent-sign, in which case the original string

"aaa bbb ccc aaabbbccc"

first becomes

"%aaa%bbb%ccc%aaabbbccc%"

or perhaps

"%aaa%bbb%ccc%aaa bbb ccc%"

if the last string had spaces in it originally.

But now when a search is done for %aaa% or %bbb% or %ccc% or
%aaa bbb ccc% you will still get a unique answer.


I will add that I am not familiar with the specific way
patterns are searched for in the DisplayNameEditor, or
stored, but this is the idea behind an approach which I
assume should work, once the appropriate modifications are
first made.

HTH.

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Gramps-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Display Name Editor - Given name bug?

prculley
Not sure this method would help any in this situation.  We would have to change the instructions for the Name editor to include the special characters, Which would probably entail changing all the translations, not just the Sloveninan language one.  I still think that finding a suitable Sloveninan synonym for one of the two words would be the easiest.

P.S. I know it is possible to construct REs that search for longest valid string first, but messing with REs is certainly not my expertise.  And the REs that do this in Gramps are not exactly the simplest ones I have ever seen, by a long shot.

Paul Culley

On Tue, Feb 7, 2017 at 1:02 PM, Paul Franklin <[hidden email]> wrote:
> Otherwise, someone who understand regular expressions will have to figure
> out a way to select the largest possible match, rather than the first match.

Well, one common way to search for a pattern which might be
a subset of other patterns is to "anchor" the pattern you
are searching for.  This is done by attaching a character to
at least one end of the pattern and typically at both ends,
a character which you know (somehow) will not be in any of
the strings you are searching.

Let's say you know that the character "space" -- " " -- will
not be in any string.  Let's further say you know that the
strings are in a longer string with space delimiters, say

"aaa bbb ccc aaabbbccc"

So the first thing to do is to attach a space on each end:

" aaa bbb ccc aaabbbccc "

Then when you search that string (using a r.e.) you just
attach a space to each end of the string you are looking
for.  Thus " aaa " or " bbb " or " ccc " or " aaabbbccc "
are all unique strings, when the longer string is checked.

It's only slightly different if a "space" character could be
part of the string you want to find.  You then have to add a
different character as the anchor, but again one which you
somehow know will never be a character in anything you are
searching for.

Perhaps a percent-sign, in which case the original string

"aaa bbb ccc aaabbbccc"

first becomes

"%aaa%bbb%ccc%aaabbbccc%"

or perhaps

"%aaa%bbb%ccc%aaa bbb ccc%"

if the last string had spaces in it originally.

But now when a search is done for %aaa% or %bbb% or %ccc% or
%aaa bbb ccc% you will still get a unique answer.


I will add that I am not familiar with the specific way
patterns are searched for in the DisplayNameEditor, or
stored, but this is the idea behind an approach which I
assume should work, once the appropriate modifications are
first made.

HTH.


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Gramps-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Display Name Editor - Given name bug?

Bernard Banko-2
Thanks for input. As said in previous mail mistakenly sent only to one Paul, i've put a PR where I think it's ok now (ime and priimek changed in plural to imena and priimki).
I wonder how it works in French with nom - prenom though ...

On Wed, Feb 8, 2017 at 2:16 AM, Bernard <[hidden email]> wrote:
I ve done a PR on Gramps42, it seems ok. Changed both words in plural - it happens to be sufficient different. I have not noticed side effect (ie. seeing Surname translated in plural also on other GUI elements where it would be more disturbing).
Master will follow.

On Tue, Feb 7, 2017 at 9:08 PM, Paul Culley <[hidden email]> wrote:
Not sure this method would help any in this situation.  We would have to change the instructions for the Name editor to include the special characters, Which would probably entail changing all the translations, not just the Sloveninan language one.  I still think that finding a suitable Sloveninan synonym for one of the two words would be the easiest.

P.S. I know it is possible to construct REs that search for longest valid string first, but messing with REs is certainly not my expertise.  And the REs that do this in Gramps are not exactly the simplest ones I have ever seen, by a long shot.

Paul Culley

On Tue, Feb 7, 2017 at 1:02 PM, Paul Franklin <[hidden email]> wrote:
> Otherwise, someone who understand regular expressions will have to figure
> out a way to select the largest possible match, rather than the first match.

Well, one common way to search for a pattern which might be
a subset of other patterns is to "anchor" the pattern you
are searching for.  This is done by attaching a character to
at least one end of the pattern and typically at both ends,
a character which you know (somehow) will not be in any of
the strings you are searching.

Let's say you know that the character "space" -- " " -- will
not be in any string.  Let's further say you know that the
strings are in a longer string with space delimiters, say

"aaa bbb ccc aaabbbccc"

So the first thing to do is to attach a space on each end:

" aaa bbb ccc aaabbbccc "

Then when you search that string (using a r.e.) you just
attach a space to each end of the string you are looking
for.  Thus " aaa " or " bbb " or " ccc " or " aaabbbccc "
are all unique strings, when the longer string is checked.

It's only slightly different if a "space" character could be
part of the string you want to find.  You then have to add a
different character as the anchor, but again one which you
somehow know will never be a character in anything you are
searching for.

Perhaps a percent-sign, in which case the original string

"aaa bbb ccc aaabbbccc"

first becomes

"%aaa%bbb%ccc%aaabbbccc%"

or perhaps

"%aaa%bbb%ccc%aaa bbb ccc%"

if the last string had spaces in it originally.

But now when a search is done for %aaa% or %bbb% or %ccc% or
%aaa bbb ccc% you will still get a unique answer.


I will add that I am not familiar with the specific way
patterns are searched for in the DisplayNameEditor, or
stored, but this is the idea behind an approach which I
assume should work, once the appropriate modifications are
first made.

HTH.




------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Gramps-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Display Name Editor - Given name bug?

Paul Franklin-5
In reply to this post by prculley
On 2/7/17, Paul Culley <[hidden email]> wrote:
> Not sure this method would help any in this situation.  We would have to
> change the instructions for the Name editor to include the special
> characters, Which would probably entail changing all the translations, not
> just the Sloveninan language one.  I still think that finding a suitable
> Sloveninan synonym for one of the two words would be the easiest.

Well, without looking at the code I can't be sure,
but I doubt there will be a problem,  Instead of (say)
_("Surname") you'd just have '%' + _("Surname") + '%'
(or whatever character would never be in a translated
string (a "#" number sign?)).  But just concatenating
the char onto the start and end would work, I think.

But I admit the name editor tables which control that
stuff are not exactly clear.

And while I admit the ease of finding suitable words,
at the very least I'd argue for a check (in code) to flag
any problems.  Or perhaps an "unstable" tool that got
run before every release?  Or something added to
one of the scripts in the "po" directory?

But I still think the "right" fix is to anchor the strings.

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Gramps-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Display Name Editor - Given name bug?

Paul Franklin-5
In case I wasn't clear, my proposal (to anchor the
strings) is to be done in code, not in any strings to
be seen by any user or translator.  No strings would
need to be changed.  "Just" code.  8-)

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Gramps-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Display Name Editor - Given name bug?

Bernard Banko-2
Pull request done also for master branch. Seems it works now. Tnx

On Wed, Feb 8, 2017 at 4:20 AM, Paul Franklin <[hidden email]> wrote:
In case I wasn't clear, my proposal (to anchor the
strings) is to be done in code, not in any strings to
be seen by any user or translator.  No strings would
need to be changed.  "Just" code.  8-)

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Gramps-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-devel


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Gramps-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-devel
Loading...