Skip to content
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

Update locales-fa-IR.xml #157

Merged
merged 1 commit into from Feb 7, 2017

Conversation

hamedheidari
Copy link
Contributor

@hamedheidari hamedheidari commented Feb 6, 2017

Hi. I'm Sorry for second edition in a short time period.
Also, I would like to ask you three questions:
1- Is it possible to localize the letters of disambiguation of citations? e.g. ([Authors], [Year][a]) >>> ([Authors], [Year]_[الف])
2- Is it possible to localize punctuation marks? e.g. [,] [;] >>> [،] [؛]
3- Mendeley does not support loading CSL locale files. Is it right?

Sorry for second edition in a short short period of time.
Also I would like to ask three questions:
1- Is it possible to localize disambiguation of citations? e.g. ([Authors], [Year][a]) >>> ([Authors], [Year]_[الف])
2- Is it possible to localize punctuation marks? e.g [,] [;] >>> [،] [؛]
3- Mendeley does not support loading CSL locale files. Is it right?
@csl-bot
Copy link
Contributor

csl-bot commented Feb 6, 2017

Awesome! You've created a pull request to the Citation Styles Language locales repository. We'll get in touch soon (usually within a day or two). In the meantime, our automated test system will go ahead and run some checks on your pull request. In a few minutes you'll be notified of the test results.

If you haven't done so yet, please make sure your locale file validates.

To update the current pull request, visit the "Files changed" tab above, and click on the pencil icon (see below) in the top-right corner of your locale file to start editing.

image

If you need assistance at any point, please leave a comment and we'll get back to you (feel free to write in Dutch, English, French, German, Portuguese, or Spanish).

@csl-bot
Copy link
Contributor

csl-bot commented Feb 6, 2017

Yay! Your pull request passed all our automated tests. We'll take a look soon.

@rmzelle rmzelle merged commit 74a9e79 into citation-style-language:master Feb 7, 2017
@rmzelle
Copy link
Member

rmzelle commented Feb 7, 2017

Hi. I'm Sorry for second edition in a short time period.

No problem!

Also, I would like to ask you three questions:
1- Is it possible to localize the letters of disambiguation of citations? e.g. ([Authors], [Year][a]) >>> ([Authors], [Year]_[الف])

No. The current scheme ("a" through "z", then "aa" through "zz", etc.) is hard-coded. What kind of scheme do you wish to use?

2- Is it possible to localize punctuation marks? e.g. [,] [;] >>> [،] [؛]

There are currently only a few punctuation marks that can be localized. The delimiters used for dates (like the one you changed in this pull request), and quotation marks and the symbol used for page ranges (see

<!-- PUNCTUATION -->
).

That said, you can create custom styles for Farsi and change most punctuation as required (CSL currently has a few hard-coded commas, I think; please report any issues you run into here).

3- Mendeley does not support loading CSL locale files. Is it right?

No, as far as I know Mendeley periodically updates the CSL locale files it uses in new releases of Mendeley Desktop (not necessarily with every release), and I don't think it's possible yet for users to update the CSL locales by themselves. (see citation-style-language/styles#880 (comment); the Mendeley developer who replied to me in that thread, cpina, is on sabbatical, though, so Mendeley might be updating its CSL locale files even less frequently than normal).

@hamedheidari
Copy link
Contributor Author

hamedheidari commented Feb 7, 2017

  <date form="text">
    <date-part name="day" suffix=" "/>
    <date-part name="month" form="numeric-leading-zeros" suffix=" "/>

I forgot to delete this section: form="numeric-leading-zeros"

@rmzelle Thank you for your prompt reply.

No. The current scheme ("a" through "z", then "aa" through "zz", etc.) is hard-coded. What kind of scheme do you wish to use?

'... الف ب پ ت ث' instead of 'a b c d e etc'
(https://en.wikipedia.org/wiki/Persian_alphabet)
And do you think there is any way to add an en dash (Alt+0150: – ) between year and year-suffix (alphabet letters)?
Please see this screenshot: https://1drv.ms/i/s!Anh3Msh8ntSFhk7uor_DA1tpKirb

You can create custom styles for Farsi and change most punctuation as required

OK. So I can create a separate style for Farsi. However I can't localize the delimiter used for publisher-place. e.g. [Tehran, Iran] تهران، ایران <<< تهران, ایران. And Mendeley MS Word Plugin doesn't support two style in a document.

@rmzelle
Copy link
Member

rmzelle commented Feb 7, 2017

I forgot to delete this section: form="numeric-leading-zeros"

You don't want leading zeros for both the "text" and "numeric" formats?

'... الف ب پ ت ث' instead of 'a b c d e etc'
(https://en.wikipedia.org/wiki/Persian_alphabet)

Do you know what happens when you run out of letters? (as I mentioned above, in English, you normally would go from "x", "y", "z", to "aa", "ab", ac", etc., to "ba", "bb", "bc", etc.)

@rmzelle
Copy link
Member

rmzelle commented Feb 7, 2017

And do you think there is any way to add an en dash (Alt+0150: – ) between year and year-suffix (alphabet letters)?

Yes. By default, the year-suffix is placed automatically, but you can change its position (and surrounding punctuation) by using something like <text variable="year-suffix" prefix="–"/>.

However I can't localize the delimiter used for publisher-place. e.g. [Tehran, Iran] تهران، ایران <<< تهران, ایران. And Mendeley MS Word Plugin doesn't support two style in a document.

CSL currently sees "publisher-place" as a dumb string (it doesn't recognize that the field contains "Tehran" and "Iran" separated by ", ", but instead just sees "Tehran, Iran"), so whatever is in the field is what's printed. Do you need both the English and Farsi translations within the same reference?

@hamedheidari
Copy link
Contributor Author

hamedheidari commented Feb 8, 2017

You don't want leading zeros for both the "text" and "numeric" formats?

I don't want that for text format.

Do you know what happens when you run out of letters?

Yes. We can use a same algorithm in Persian. Something like this: https://1drv.ms/i/s!Anh3Msh8ntSFhlBg9T9Yb8O7mZo7
Although in fact we need just two or three letters. And 26 letters (English) or 28 (Abjad) or 32 (Persian) would be more than enough.
This subject is more important for RTL languages (Farsi, Arabic, etc) than others. because adding English letters through that, might disrupt the sentence.

By default, the year-suffix is placed automatically, but you can change its position. by using something like <text variable="year-suffix" prefix="–"/>

Thanks. Done. How about RTL Text Direction? (for Bibliography in MS Word, as default). It does change to LTR, if I add a citation.

Do you need both the English and Farsi translations within the same reference?

No. I mean, sometimes we have English references; sometimes we have Farsi references (entirely Farsi); sometimes we have both of them and should be list in a document. and we can't use two style in a document. I think that's a problem related to Mendeley.

I Trying to solve this problems for a lot of people who lives in middle east, absolutely with your help.

@rmzelle
Copy link
Member

rmzelle commented Feb 9, 2017

You don't want leading zeros for both the "text" and "numeric" formats?

I don't want that for text format.

Fixed: b01a5e4

Yes. We can use a same algorithm in Persian.

Okay, great. Issue created (citation-style-language/schema#136), although it might be a while before we can add support for non-English year suffixes.

How about RTL Text Direction? (for Bibliography in MS Word, as default). It does change to LTR, if I add a citation.

What happens, exactly? The whole citation changes to LTR whenever there is year-suffix disambiguation?

No. I mean, sometimes we have English references; sometimes we have Farsi references (entirely Farsi); sometimes we have both of them and should be list in a document. and we can't use two style in a document. I think that's a problem related to Mendeley.

That's a limitation in CSL that we're aware of. It's a priority to add support for references in different languages in a single bibliography, but again it might take a while.

@hamedheidari
Copy link
Contributor Author

hamedheidari commented Feb 10, 2017

@rmzelle Thank you so much.

What happens, exactly? The whole citation changes to LTR whenever there is year-suffix disambiguation?

I made a short video to explain this problem. (20s/ 804kb).
https://www.dropbox.com/s/lnyzpe0be4z41km/Mendeley-RTL.mp4?dl=0

@rmzelle
Copy link
Member

rmzelle commented Feb 12, 2017

I made a short video to explain this problem. (20s/ 804kb).
https://www.dropbox.com/s/lnyzpe0be4z41km/Mendeley-RTL.mp4?dl=0

So any time Mendeley refreshes the bibliography, it becomes LTR?

@hamedheidari
Copy link
Contributor Author

hamedheidari commented Feb 12, 2017

@rmzelle Yes, exactly.
Last my question (!): How does CSL (or Mendeley) differentiate 'number of pages' from 'pages'? I guess If 'type: book' > number of pages; if else > pages.

@adam3smith
Copy link
Member

adam3smith commented Feb 12, 2017

CSL is agnostic about page/number-of-pages. You can have both for the same item, in theory, though that'd be highly unusual in practice. In Mendeley, it does indeed look like it behaves like you say. In Zotero, for example, "Pages" and "# of Pages" are differently named fields, which I think is a better solution.

For your RTL-->LTR issue, in the end that's Mendeley, not CSL, too, but see if Mendeley applies a Word style (see https://support.office.com/en-us/article/Customize-styles-in-Word-D38D6E47-F6FC-48EB-A607-1EB120DEC563 ) to the bibliography. You may be able to fix that to RTL.

@rmzelle
Copy link
Member

rmzelle commented Feb 12, 2017

How does CSL (or Mendeley) differentiate 'number of pages' from 'pages'?

CSL has two separate variables, "number-of-pages" and "page", but Mendeley might only be using the latter (incorrectly).

@rmzelle
Copy link
Member

rmzelle commented Feb 12, 2017

@fbennett, do I recall correctly that you did some work to get RTL to work correctly in citeproc-js? Could you take a brief look at #157 (comment), and tell us whether you think this is a problem in citeproc-js or Mendeley? Does citeproc-js automatically apply RTL for styles used with RTL locales?

@hamedheidari
Copy link
Contributor Author

hamedheidari commented Feb 12, 2017

@adam3smith @rmzelle Thank You.
Apparently Text Direction for Bibliograpghy is dependent on 'Normal' style in Word. (Just 'Normal' style, not others even though that was selected). Because that issue happens oppositely, if I change Text Direction in 'Normal' style. (English references becomes RTL with any bibliography refresh)

@fbennett
Copy link
Member

@rmzelle There is some (long-stale) code in the processor that attempts to force RTL on items set to certain languages (["ar", "he", "fa", "ur", "yi", "ps", "syr"]), using Unicode characters that (theoretically) impose text direction. It is controlled by a processor toggle that is currently set false by default. If I remember correctly, Word and LibreOffice handle RTL inserts differently, and at the time that code was written (years ago), we weren't able to get the output correct in both environments. We could try turning the toggle on in a Propachi variant to see if it helps in @Hamedheydari's document ... ?

@rmzelle
Copy link
Member

rmzelle commented Feb 13, 2017

We could try turning the toggle on in a Propachi variant to see if it helps in @Hamedheydari's document ... ?

@Hamedheydari is using Mendeley, so that wouldn't work.

Apparently Text Direction for Bibliograpghy is dependent on 'Normal' style in Word. (Just 'Normal' style, not others even though that was selected). Because that issue happens oppositely, if I change Text Direction in 'Normal' style. (English references becomes RTL with any bibliography refresh)

Ah, yes, if you have mixed references in RTL and LTR languages in a single bibliography, this can't be fixed by modifying the word processor style.

@fbennett
Copy link
Member

I'll write to the developers there with the suggestion, so they can pick it up.

@rmzelle
Copy link
Member

rmzelle commented Feb 13, 2017

I'll write to the developers there with the suggestion, so they can pick it up.

You have good contacts at Mendeley?

@fbennett
Copy link
Member

fbennett commented Feb 13, 2017

Just @cpina (hi, Carles, welcome to the issue :)

@adam3smith
Copy link
Member

Carles is on sabbatical; specifically (and I'm not making this up) on a boat circumnavigating antarctica.

@fbennett
Copy link
Member

fbennett commented Feb 13, 2017

Oh yes, of course. How could I have forgotten that. Silly me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants