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

Title case, record with no language, english case is applied instead of desired locale #162

Open
3 tasks done
glorieux-f opened this issue Aug 2, 2023 · 0 comments
Open
3 tasks done

Comments

@glorieux-f
Copy link
Contributor

glorieux-f commented Aug 2, 2023

Please follow the general troubleshooting steps first:

  • I read the README and followed the instructions.
  • I am sure that the used CSL metadata follows the CSL schema.
  • I use a valid CSL stylesheet

Bug reports:

citeproc-php, locale fr-FR or en-US, case of container-title is modified when !isset(language) || language == "en". Other bug, capitalizeForTitle seems to be not unicode, friendly (? Util/StringHelper.php#L96 )

  • Piaget, J. (1922). language=en. L’Éducateur : Organe De La Société pédagogique De La Suisse Romande, LVIII(3), 33-39.
  • Piaget, J. (1922). language=fr. L’Éducateur : organe de la Société pédagogique de la Suisse romande, LVIII(3), 33-39.
  • Piaget, J. (1922). no language. L’Éducateur : Organe De La Société pédagogique De La Suisse Romande, LVIII(3), 33-39.

zotero desktop, locale fr-FR, if no language, case is modified according to the locale (fr)

  • Piaget, J. (1922a). Language=en. L’Éducateur : Organe de La Société Pédagogique de La Suisse Romande, LVIII(3), 33‑39.
  • Piaget, J. (1922a). Language=fr. L’Éducateur : organe de la Société pédagogique de la Suisse romande, LVIII(3), 33‑39.
  • Piaget, J. (1922b). No language. L’Éducateur : organe de la Société pédagogique de la Suisse romande, LVIII(3), 33‑39.

zotero desktop, locale en-US, if no language, case is modified according to the locale (en)

  • Piaget, J. (1922a). Language=en. L’Éducateur : Organe de La Société Pédagogique de La Suisse Romande, LVIII(3), 33–39.
  • Piaget, J. (1922b). Language=fr. L’Éducateur : organe de la Société pédagogique de la Suisse romande, LVIII(3), 33–39.
  • Piaget, J. (1922c). No language. L’Éducateur : Organe de La Société Pédagogique de La Suisse Romande, LVIII(3), 33–39.

Workaround, ensure language for each record.

Proposed fix Rendering/Text.php#L92

    $lang = (isset($data->language)) ? 
        $data->language : 
        strtok(CiteProc::getContext()->getLocale()->getLanguage(), '-');

Used CSL stylesheet:

apa.csl#L1217

    <text variable="container-title" font-style="italic" text-case="title"/>

Used CSL metadata

[
    {
        "id": "http://zotero.org/groups/5048422/items/S4RL74HB",
        "type": "article-journal",
        "container-title": "L’Éducateur : organe de la Société pédagogique de la Suisse romande",
        "issue": "3",
        "page": "33-39",
        "title": "no language",
        "volume": "LVIII",
        "author": [
            {
                "family": "Piaget",
                "given": "Jean"
            }
        ],
        "issued": {
            "date-parts": [
                [
                    "1922"
                ]
            ]
        }
    },
    {
        "id": "http://zotero.org/groups/5048422/items/S4RL74HB",
        "type": "article-journal",
        "container-title": "L’Éducateur : organe de la Société pédagogique de la Suisse romande",
        "language": "fr",
        "issue": "3",
        "page": "33-39",
        "title": "language=fr",
        "volume": "LVIII",
        "author": [
            {
                "family": "Piaget",
                "given": "Jean"
            }
        ],
        "issued": {
            "date-parts": [
                [
                    "1922"
                ]
            ]
        }
    },
    {
        "id": "http://zotero.org/groups/5048422/items/S4RL74HB",
        "type": "article-journal",
        "container-title": "L’Éducateur : organe de la Société pédagogique de la Suisse romande",
        "language": "en",
        "issue": "3",
        "page": "33-39",
        "title": "language=en",
        "volume": "LVIII",
        "author": [
            {
                "family": "Piaget",
                "given": "Jean"
            }
        ],
        "issued": {
            "date-parts": [
                [
                    "1922"
                ]
            ]
        }
    }
]
glorieux-f added a commit to glorieux-f/citeproc-php that referenced this issue Aug 3, 2023
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

No branches or pull requests

1 participant