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

Suggested improvements to CoCids and localization #1584

Closed
3 tasks done
lozanoje opened this issue Aug 6, 2024 · 9 comments
Closed
3 tasks done

Suggested improvements to CoCids and localization #1584

lozanoje opened this issue Aug 6, 2024 · 9 comments
Labels
enhancement New feature or request

Comments

@lozanoje
Copy link
Contributor

lozanoje commented Aug 6, 2024

Several issues with CoCids and localization

If I understand right, cocid were created to make localization easy, having several documents in different languages with same cocid, might show each client the version on her language, if cocid matches.

Currently CoCids works as follows: in the character sheet, if there is a skill with a cocid, then searches for all the skills in the world with the same cocid and shows the one with higher priority. Also, there is a priority for world documents over compendium/modules.

First issue: Currently it is not working as it is suposed to be, if I create a skill in the world with Spanish name and higher priority than the one in a character sheet (of a pregen, for instance), it doesnt change to the spanish name in the char sheet - not sure if this is the expected behaviour.
Second issue: the priority of world documents over module documents (in compendium) makes imposible to override world documents. Scenario: premium content imports equipment with cocid to the world, I activate a translation module with the same equipment (cocid) with spanish name and wont be translated because world documents precedes module documents.
Third issue: when using cocid maybe (I am not totally sure on this) cocids in the same language of the client language should always precede other languages documents with the same cocid.

@lozanoje lozanoje added the bug Something isn't working label Aug 6, 2024
@snap01
Copy link
Collaborator

snap01 commented Aug 8, 2024

  1. This is working as expected
  • Once an Item is added to an Actor it remains unchanged, when you add an Item, to an Item like Setup or Occupation you are given the option of adding it as a CoC ID (which will be updated at the time of it being added to the Actor) or as the Item which will be the item you dragged in at the time.
  • Recalculating this every time an Actor is opened would cause a slowdown and mean that any changes made would be reset each time you opened the sheet.
  1. When picking the "Best" match it tries these in order
    i) If no eras are ticked or if any are ticked one of them must match the world era
    ii) Of these the language must match game.i18n.lang or en, if it matches game.i18n.lang that is preferred
    iii) Then if any of the matches were found in the world World they have priority over Compendiums
    iv) Finally sort by Priority and only return the highest

The current plan is for items (skills, weapons, books, etc) to be distributed in compendiums.

@lozanoje
Copy link
Contributor Author

lozanoje commented Aug 9, 2024

Hey, James, thanks for comment.

When first ids appeared in RQG (thanks to @wake42 and @Moonpile) I think the core idea of it was to make localization easy. Was an amazing idea that allow to have documents in different languages allowing the user to be shown their localization counterpart. As currently is, I think we are half the way of achieving it.

We’ve been discussing lately at discord development server about it, and I mentioned constantly updating ids might severely impact the db performance, so @wake42 suggested to create a macro/function to update ids on demand.

My (probably profane) thoughts is that a way not to update documents constantly is:

  • Create the function to update documents information based on ids (except those related with stats: base chance, gained experience, etc)
  • Place a button in system settings to update all db ids (this is subject to testing, depending on the time it takes to update all documents in the world)
  • Place a button in the character sheet available when in edit mode only to update to the latest version of the id all documents in the current actor
  • Remove the priority of world over compendia – as it is it, it forces the user to import all document in their shared compendia to supersede world documents. This apply to premium modules with updated counterparts of documents already in the world (skills, occupations or professions)

@wake42
Copy link

wake42 commented Aug 14, 2024

I tried to summarize how I see rqid:s in the documentation page for RQG: https://sun-dragon-cult.github.io/rqg-system/api/rqid It's a bit on the long side, but I've tried to keep it as short as possible without loosing detail.

Currently there is no way to switch language of a world, but I agree with @lozanoje that it should be possible to manually initiate such a switch.

I've also thought a bit more about if world documents always should have higher prio compared to compendium documents, and again I agree with @lozanoje that they probably should not. Priority should be the compared across world and compendium documents alike. In RQG the rqid, priority and language are added to what is indexed about compendiums, so it should not be a big performance hit to do this I think.

@pconcepcion
Copy link
Contributor

For me it's also confusing that somehting with higher priority on a compendium in the end has less priority than something in the world with a lesser priority. I agree that priority should be the compared across world and compendium documents alike

@lozanoje
Copy link
Contributor Author

lozanoje commented Aug 20, 2024

Hey, I've just released a new version of my spanish CoC7 translation module and I've added two macros:

  1. Token item updater - updates all items in the actor linked to the selected token: https://github.com/lozanoje/fvtt-module-CoC7-es/blob/master/scripts/fvtt-Macro-token-items-updater-(CoC7).js
  2. Actors item updater - updates all items in all actors currently in the world: https://github.com/lozanoje/fvtt-module-CoC7-es/blob/master/scripts/fvtt-Macro-actor-items-updater-(CoC7).js

The update procedure is: replace all names and descriptions on an actor based on the cocid - chooses the highest priority among those in the same language of the world - searches in world and compendia items alike

Might contain issues

https://youtu.be/llzD9HAPvks

@lozanoje
Copy link
Contributor Author

I tried to summarize how I see rqid:s in the documentation page for RQG: https://sun-dragon-cult.github.io/rqg-system/api/rqid It's a bit on the long side, but I've tried to keep it as short as possible without loosing detail.

Finally, took the time to read the entire document. Brilliantly explained, also, learned some stuff I didnt know about rqgids, thanks, mate!

@snap01
Copy link
Collaborator

snap01 commented Aug 25, 2024

A change for this should be in the next release

When getting documents from compendiums they are now kept as indexes until all sorting and best filtering has been performed. The scope type match has been removed.

Now the process is

  1. If no eras are ticked or if any are ticked one of them must match the world era
  2. Of these the language must match game.i18n.lang or en, if it matches game.i18n.lang for the same id those are preferred
  3. Sort by Priority, if both match then prefer world over compendiums
  4. If Best only return the first of each option

@snap01 snap01 changed the title Several issues with CoCids and localization Suggested improvements to CoCids and localization Sep 1, 2024
@snap01 snap01 added enhancement New feature or request and removed bug Something isn't working labels Sep 1, 2024
@snap01
Copy link
Collaborator

snap01 commented Sep 1, 2024

An additional change for this should be in the next release

On the left hand menu bar for Keeper's tools there is a new button for updating Actors with the following options

  • Update all tokens on this scene
  • Update open Actor sheets
  • Update all Actors in directory

@lozanoje
Copy link
Contributor Author

lozanoje commented Sep 2, 2024

Great, thank you!

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

4 participants