opral / inlang-sdk

0 stars 0 forks source link

rename `bundle` to `key`? #224

Open samuelstroschein opened 3 weeks ago

samuelstroschein commented 3 weeks ago

Proposal

Rename bundle to key to align with user expectations and reduce communication effort.

Context

Bundles are "breaking" the communication model of "messages" and will lead to confusion and higher effort of releasing the inlang sdk v2.

Example: Paraglide JS

  1. Paraglide JS users import messages from paraglide-js/messages.

With the introduction of bundles, they import a bundle now though which is still a message. If that sentence confused you, that's the problem.

import * as m from "paraglide-j/messages/index.js" 

// this is referencing a bundle
const output = m.happy_elephant()

// but the output is a message
console.log(output) -> "You need to login!"
  1. The term bundle clashes with compiling.

The output of compiling an app is a bundle. We will have to have warnings in the documentation to not confuse a message bundle and app bundle.

CleanShot 2024-10-04 at 14.51.51@2x.png

Example: Sherlock

Sherlock used to extract messages but now it's a bundle.

CleanShot 2024-10-04 at 14.39.27@2x.png

Example Fink

Fink allows adding a bundle. Every other CAT editor refers to this as adding a new key.

CleanShot 2024-10-04 at 14.44.24@2x.png

Screenshot from Lokalise

CleanShot 2024-10-04 at 14.45.08@2x.png

Screenshot from Tolgee

CleanShot 2024-10-04 at 14.45.49@2x.png