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

RFF: Script to fetch container language assets #1

Open
msoutopico opened this issue Apr 14, 2020 · 0 comments
Open

RFF: Script to fetch container language assets #1

msoutopico opened this issue Apr 14, 2020 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@msoutopico
Copy link
Owner

Currently: The customization script launches a dialog where the use enters the URL (e.g. https://cat.capstan.be/OmegaT/index.php) from which OmegaT will fetch the custom files. The idea to develop this further was that we would have a different URL for each customization required, assuming we would need a different customization for each project. The PM would include that URL in the instructions of the project kit and then the user would to enter it in the customizer’s dialog to fetch custom files for that project.

However, since most of the custom files are not project-dependent, the updates for each project would be minimal.
• Tag definitions -> unless they become project-based in the meanwhile
• Merged TMs -> Done with cApps?
• Glossaries

Therefore, it makes sense to have one single customization script, and then another script that fetches certain project-specific assets or settings in the background.

This script will:

  1. Run when a project loads.
  2. Check whether the project has already assets, checking for existence of folder /tm/auto/memoryln
    a. If folder /tm/auto/memoryln exists and contains tmx files, it stops.
    b. If folder /tm/auto/memoryln is not found, or is empty, it continues.
  3. Check whether a working internet connexion exists:
    a. If none, warns the user: “You need to be connected to the internet to update your customization for this project. Close OmegaT, connect to the internet and open the project again.”
    b. If found, continue to the next step.
  4. Download and parse a properties* file (XML or Json) from a fixed address, which states the customization needed, its latest version, location, etc. for each container.
  5. Extract the container from the project name (for each container in the properties, find the one of the current project -> provide example).**
  6. Extract the language combination from the project settings.
  7. Fetch path to the project, and close the project
  8. Edit the OmegaT preferences (omegat.prefs) to update the custom tag settings
  9. Edit the OmegaT project settings (omegat.project) to add links for reference TMs, based on the template name in properties, updated with the language settings.
  10. Open the project again

2* Example of Json properties: https://cat.capstan.be/OmegaT/project-assets.json

3** Logic to get container:

  • Get projectName
  • Get array of containers
  • For each container in containers, test projectName.match(/^container(?=_)/)
  • When true, get container
@msoutopico msoutopico self-assigned this Jun 15, 2020
@msoutopico msoutopico added the enhancement New feature or request label Jun 15, 2020
@msoutopico msoutopico changed the title OmegaT project-based customization dialog RFF: Script to fetch container language assets Jul 16, 2020
msoutopico pushed a commit that referenced this issue Oct 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant