opral / inlang-fink

Issue tracker for fink
0 stars 0 forks source link

Editor pushes messages to the root when project.inlang is below a subdirectory #8

Closed Mohamed-Hacene closed 2 months ago

Mohamed-Hacene commented 2 months ago

Description

Hi ! I'm currently having an issue with Fink that I've never seen before. When I go on the online editor, it detects correctly my messages files and my translations. However, when I have edited them and I push on my branch, it creates a /messages folder, with all translations, in the root of my repository instead of modifying the current translations I already have in /frontend/messages

Configuration

Here is my project structure:

|--backend
|--frontend
   |--project.inlang
      |--project_id
      |--settings.json
   |--messages
      |--en.json
      |--fr.json

And here is the settings.json:

{
    "$schema": "https://inlang.com/schema/project-settings",
    "sourceLanguageTag": "en",
    "languageTags": ["en", "fr"],
    "modules": [
        "https://cdn.jsdelivr.net/npm/@inlang/message-lint-rule-empty-pattern@latest/dist/index.js",
        "https://cdn.jsdelivr.net/npm/@inlang/message-lint-rule-identical-pattern@latest/dist/index.js",
        "https://cdn.jsdelivr.net/npm/@inlang/message-lint-rule-missing-translation@latest/dist/index.js",
        "https://cdn.jsdelivr.net/npm/@inlang/message-lint-rule-without-source@latest/dist/index.js",
        "https://cdn.jsdelivr.net/npm/@inlang/message-lint-rule-valid-js-identifier@latest/dist/index.js",
        "https://cdn.jsdelivr.net/npm/@inlang/plugin-message-format@latest/dist/index.js",
        "https://cdn.jsdelivr.net/npm/@inlang/plugin-m-function-matcher@latest/dist/index.js"
    ],
    "plugin.inlang.messageFormat": {
        "pathPattern": "./messages/{languageTag}.json"
    }
}

Question

It never did that before and I didn't change anything in my configuration since I use Inlang and Fink editor. I don't understand if it's coming from a regression or maybe a release which changes the base structure of an inlang project ?

NiklasBuchfink commented 2 months ago

@Mohamed-Hacene Thank you for submitting this issue

cc @jldec Do you know, if this related to a recent change in the inlang-message-sdk?

jldec commented 2 months ago

I just tried, and reproduced the bad behavior when the project is not at the root. https://github.com/jldec/jldec-repro-8 https://github.com/jldec/jldec-repro-8/commit/8cb6126e25b7b8e3f0e5991f9a61f29c4654e18d

this did not reproduce on a repo with a root-level project.inlang https://github.com/jldec/load-test/commit/88f511b00624abae77ef1f1de1414b7e11948618

Mohamed-Hacene commented 2 months ago

Ok thanks, so is this a real issue or am I supposed to always root the project inlang? If it's the latter, I wonder why I haven't encountered this bad behavior before.

jldec commented 2 months ago

yes - it's a real issue - thanks for reporting (for now you can move the project to the root - but that should not be necessary and doesn't help in monorepos with multiple projects)

Mohamed-Hacene commented 2 months ago

No problem, I will translate manually for now, waiting for a fix, thanks you both for the quick answer :)

jldec commented 2 months ago

@Mohamed-Hacene this issue should be resolved now - thanks for your patience.

Mohamed-Hacene commented 2 months ago

@jldec I confirm, thank you for your responsiveness