Difference between revisions of "Figma to Dev Generation Details"

From Lingoport Wiki
Jump to: navigation, search
(Key Changes)
(Edits in Figma Files or Developer Files: Who Wins?)
Line 29: Line 29:
 
For the generated key/value from Figma, '''any change in Figma''' (updated value, new string, etc.) will overwrite '''all the generated resources''' in the target file. It will not affect key/value pairs which were created outside of the generation, as for instance an error message which would not be part of the Figma design.
 
For the generated key/value from Figma, '''any change in Figma''' (updated value, new string, etc.) will overwrite '''all the generated resources''' in the target file. It will not affect key/value pairs which were created outside of the generation, as for instance an error message which would not be part of the Figma design.
   
'''Figma wins''' below means that all the key values coming from Figma are recreated and overwrite any edits done on those values by the developers. Key/value pairs created ''outside'' of the Figma2Dev generation are not touched. In the same developer files, you can have key/value pairs generated from Figma, and others created by developers, outside of the Figma design.
+
'''Figma wins''' below means that all the key values coming from Figma are recreated and overwrite any edits done on those values by the developers. Key/value pairs created ''outside'' of the Figma2Dev generation are not touched. In the same developer files, you can have key/value pairs generated from Figma, and others created by developers, ''outside'' of the Figma design.
   
 
Here are some scenarios that may occur when editing both Figma and LRM resource files:
 
Here are some scenarios that may occur when editing both Figma and LRM resource files:

Revision as of 21:15, 26 November 2025

Figma Projects: For UI/UX Designers

Designers create interfaces in Figma, use the Figma Lingoport Plugin to push the strings to a Localyzer Figma Project. Those Figma strings can be translated. The translations can be shown in Figma using the Figma Lingoport plugin.

The Figma strings are kept in a repository. This repository is not for developers, it is only for Localyzer.

In the Figma repository, Figma files are located in 'figma/locales/<locale>/translation.json'. For example:

  • figma/locales/en/translation.json
  • figma/locales/fr/translation.json

In the Figma project, keys are created. Those keys will be used to generate the key/value pairs for Developer files via the messages.properties intermediary files. The Keys Figma File is located under:

  • figma/locales/keys/translation.json

In parallel, some intermediary Figma Files are created to show the key/value pairs as a preparation step to generating Developer files. Their location follows this pattern:

  • figma/locales/en/messages.properties
  • figma/locales/fr/messages.properties

Source strings, translated strings, and keys are all visible from Figma using the Figma Lingoport Plugin.

Figma2Dev Projects: For Software Developers

Software developers can benefit from having resource files generated from the Figma Projects directly in a repository and format of their choice. Key value pairs for the Developer files (resource files) can be generated from the source and target strings of the Localyzer Figma project. To create a Figma to Dev project, see: Create_a_Localyzer_only_project#Figma_to_Dev

Developers files, generated or authored by developers, are typically resx, properties, JSON, .strings, strings.xml files.

Edits in Figma Files or Developer Files: Who Wins?

After initial translation of Figma project and generation of developer resource files, changes may occur in either. What happens to the generated resources for developers?

For the generated key/value from Figma, any change in Figma (updated value, new string, etc.) will overwrite all the generated resources in the target file. It will not affect key/value pairs which were created outside of the generation, as for instance an error message which would not be part of the Figma design.

Figma wins below means that all the key values coming from Figma are recreated and overwrite any edits done on those values by the developers. Key/value pairs created outside of the Figma2Dev generation are not touched. In the same developer files, you can have key/value pairs generated from Figma, and others created by developers, outside of the Figma design.

Here are some scenarios that may occur when editing both Figma and LRM resource files:

Key Changes

  • A new key has been created in the Figma file(s) -> Figma wins
  • Key in Figma source value has changed since last time generation was run -> Figma wins
  • Key in Figma target value has changed since last time generation was run -> Figma wins
  • Developer changed a Figma key (in effect, same as a key outside of Figma) in the Dev resource file and the change was imported -> Developer wins
  • New key/value pairs are added in the Developer file -> Those are not affected

Value Changes

  • If any value of either the Figma source file or its corresponding Figma translated file have changed since last time generation was run -> Figma wins
    • After the conversion both the Figma resource base file and target file have changed
    • There will be no NOT_IN_LRM error that usually occurs when both the base and target files have the same new key.

Restriction on the Developer Files Generation

  • Generation of Developer Files from Figma project cannot happen when the Figma2Dev project has outstanding prep kits
  • Parser type must support generation. The following parser types do not support Figma -> Dev generation.
    • text
    • binary
    • html
    • xhtml
  • Parser types such as json or yaml cannot have language or global tags defined