As more components add translations, some strings are being duplicated (e.g., Close) and lead to more t9n bundles in the codebase, which could be streamlined.
Additional considerations
provide guidelines to ensure string bundles are small and contain enough strings (cap on translations per common bundle?)
compare initial load/render time between approaches
need to update t9n utils/interface to merge common bundle
define non-component asset location
message fetching logic would need to
use the same request/promise to avoid multiple fetches of the common bundle when initialized.
merge the common and component messages when setting it on the component
types should accommodate ☝️as well
ensure the common bundle strikes a good balance between file size and included props (including browser compression and caching).
exploring bundle-splitting after reaching a certain size would be worthwhile
using linting rules to keep the common bundle in check
defining guidelines on when a string is used enough to be moved into the common bundle.
updating the translations-json.json-generating logic
cc @anveshmekala
Desired Outcome
less duplicate code to download on the client side
possibly enable quicker translation support on components (e.g., if a component only needs a few common strings)
Background
As more components add translations, some strings are being duplicated (e.g.,
Close
) and lead to more t9n bundles in the codebase, which could be streamlined.Additional considerations
t9n
utils/interface to merge common bundletranslations-json.json
-generating logiccc @anveshmekala
Desired Outcome