-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using lg sh or ah with rest api doesn't translate title to hebrew #38
Comments
I believe the API always returns Hebrew as a separate field - so you should
use lg=s or lg=a only. lg=ah and lg=sh are designed for the HTML website,
not for the API.
…On Sat, Oct 12, 2019 at 10:34 AM Roi Dayan ***@***.***> wrote:
When I use lg=ah or lg=sh. i dont get the title translate into hebrew.
When using lg=h its fine.
the issue is maybe from line 753 in local/share/perl/site_perl/Hebcal.pm
the check is only for "h"
if ($lang eq "h" || $lang_european{$lang}) {
my $xsubj = Hebcal::translate_event($evt, $lang);
if ($xsubj && $xsubj ne $subj) {
$item{title_orig} = $subj;
$subj = $xsubj;
}
}
looking in translate_event() the check is also for "ah" and "sh"
} elsif ($lang eq "h" || $lang eq "ah" || $lang eq "sh") {
return $evt->{hebrew};
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#38?email_source=notifications&email_token=AA4YFVMHOYVHLZJ33BCBML3QOIDEDA5CNFSM4JADXA5KYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HRMHPEQ>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AA4YFVLSRRI3CQUQCIF72DLQOIDEDANCNFSM4JADXA5A>
.
|
right. just the hebrew key and title key sometimes little different.
|
I was rethinking. it should work. like fr should translate to france. options 'h', 'ah', 'sh' documented as supported in the rest api. looks like the issue is just checking lang eq 'h' only, while the inner callback does check every option possible. I think maybe the first check is redundant and line 753 can be removed. calling translate_event() is doing the check and if nothing is needed returns undef which means title key wont be changed. a user supposedly can send the lang according to "locale" like 'h' or 'fr' etc and always use key 'title'. |
When using lg=ah or lg=sh the title is not translated into hebrew.
When using lg=h its fine.
the issue is maybe from line 753 in local/share/perl/site_perl/Hebcal.pm
https://github.com/hebcal/dotcom/blob/master/local/share/perl/site_perl/Hebcal.pm
the check is only for "h"
looking in translate_event() the check is also for "ah" and "sh"
The text was updated successfully, but these errors were encountered: