Repository: vscode
Issue: Simplify NLS IDs
Labels: feature-request,l10n-platform,under-discussion,engineering

## Problem

This is some source code that uses NLS:
```ts
const res = await this._dialogService.confirm({
    type: 'info',
    message: nls.localize('restart1', "Profile Extensions"),
    detail: nls.localize('restart2', "In order to profile extensions a restart is required. Do you want to restart '{0}' now?", this.productService.nameLong),
    primaryButton: nls.localize('restart3', "&&Restart"),
    secondaryButton: nls.localize('cancel', "&&Cancel")
});
```

These NLS calls use hand-crafted IDs. Very often, these IDs are meaningless and we need to add "comments" for the translators anyway.
But still, it requires effort and mental energy to come up with these unique IDs.

Especially when other IDs are involved, their relationship is unclear:
```ts
'editor.minimap.enabled': {
    type: 'boolean',
    default: defaults.enabled,
    // How does `minimap.enabled` relate to `editor.minimap.enabled`?
    // Shouldn't the NLS id be `editor.minimap.enabled` too?
    description: nls.localize('minimap.enabled', "Controls whether the minimap is shown.")
},
'editor.minimap.autohide': {
    type: 'boolean',
    default: defaults.autohide,
    description: nls.localize('minimap.autohide', "Controls whether the minimap is hidden automatically.")
},
'editor.minimap.size': {
    type: 'string',
    enum: ['proportional', 'fill', 'fit'],
    enumDescriptions: [
        // Here, proportional refers to the enum value, but doesn't occur in the text.
        // This could lead to inconsistencies when the enum value is being renamed.
        nls.localize('minimap.size.proportional', "The minimap has the same size as the editor contents (and might scroll)."),
        nls.localize('minimap.size.fill', "The minimap will stretch or shrink as necessary to fill the height of the editor (no scrolling)."),
        nls.localize('minimap.size.fit', "The minimap will shrink as necessary to never be larger than the editor (no scrolling)."),
    ],
    default: defaults.size,
    description: nls.localize('minimap.size', "Controls the size of the minimap.")
},
```

## Idea

To reduce the effort of coming up with NLS IDs, I suggest to use random computer generated ids.

Extensive tooling support would assist with generating such ids.

## Implementation

With random IDs, the code could look like this:

```ts
const res = await this._dialogService.confirm({
    type: 'info',
    message: nls.localize('9csKXyeV', "Profile Extensions"),
    detail: nls.localize('Mw2DXaQ2', "In order to profile extensions a restart is required. Do you want to restart '{0}' now?", this.productService.nameLong),
    primaryButton: nls.localize('BDiPzE11', "&&Restart"),
    secondaryButton: nls.localize('Xwjwmvkt', "&&Cancel")
});
```

Extensions could help to create such ids (for a different NLS call/syntax however, just as proof of concept here):

![recording](https://user-images.githubusercontent.com/2931520/180491565-45e9e281-d889-48a4-b7b0-67ef465fab52.gif)

Especially with multi cursors, wrapping text in NLS calls would be very convenient.

## Additional Thoughts

1) Why IDs and not just text? (`localize("In order to profile extensions a restart is required.")`)
    * IDs allow distinguishing the same English texts, which may be translated differently in other languages.
    * IDs allow to keep track of text changes, so that translators can keep the old translation.
2) Why random IDs?
    * If the ID is just a function of the text, argument 1 applies.
    * If the ID has some unclear meaning, it requires mental energy to come up with such an ID. Random IDs just don't have any meaning by definition.
    * They can be generated by tools
    * They don't need to be updated when the text changes.

FYI @TylerLeonhardt