agentleFS
JuliaPlutoJuliaPluto/Pluto.jl/.cursor/rules/localization.mdc

Pluto.jl / rules

Cursor rule5.4k starsChanged 12 months agoMITView on GitHub

How to localize strings in the Pluto.jl frontend.

1 other project uses a version of this.

Trending

Less talk lately.about the whole repository

Dec 2025: 0 mentionsJan 2026: 0 mentionsFeb 2026: 0 mentionsMar 2026: 0 mentionsApr 2026: 0 mentionsMay 2026: 1 mentionJun 2026: 20 mentionsJul 2026: 14 mentionsAug 2026: 3 mentionsSep 2026: 2 mentionsOct 2026: 6 mentionsNov 2026: 4 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the JuliaPluto/Pluto.jl repository that our weekly crawl found. There is no adoption data for this file yet.

Most recently taken up by

Who's talking about JuliaPluto/Pluto.jl

The biggest 5 of 50 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 50

Talked about on GitHub (50 times).

On GitHub · 50

45 more on GitHub
  • Other versions1 project uses a version of this.

    Word for word · 1

    1. fonsp/Pluto.jl★ 5.4k100% same

    Edited · 0

    None found.

    Wrote their own version · 0

    None found.

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • Where files are headingNew Cursor rule files have more rules about planning and tracking tasks, and fewer about code style.

    Of the Cursor rule files we read, the 4,243 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.

  • In this repository3 other files it gives its agents.

The file

We split this localization.mdc into the rules it gives an agent

9 rules. About 0 are common, 5 are distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use for plain text strings (button titles, tooltips, etc.):

    line 21
  2. Distinctive:

    Use for content that contains HTML markup or Preact elements:

    line 27
  3. Very specific:

    Add new languages following the pattern: {language}.json

    line 47
  4. Distinctive:

    Always localize user-facing strings: - Never hardcode English text

    line 64
  5. Very specific:

    Consistent interpolation: - Use {{variable}} syntax for placeholders

    line 66
  6. Very specific:

    HTML-safe content: - Use th() for any content containing markup

    line 67
  7. Distinctive:

    Pluralization: - Use separate keys for singular/plural forms when needed

    line 68
  8. Very specific:

    Fallback coverage: - Ensure all keys exist in english.json (fallback language)

    line 69
  9. Distinctive:

    Complete sentences: - Always localize complete sentences, not just parts of them.

    line 70

≈ “Common” is an estimate: at least 1 in 5 of the 6,809 Cursor rule files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
localization.mdc
---
description: How to localize strings in the Pluto.jl frontend.
globs: *.js
alwaysApply: false
---

# Pluto.jl Frontend Localization

Pluto.jl uses i18next for internationalization. All user-facing strings should be localized. Always localize complete sentences, not just parts of them.

## Usage

### Import Functions
```js
import { t, th } from "../../lang/lang.js"
```

### Translation Functions

#### `t(key, options?)` - Plain Text
Use for plain text strings (button titles, tooltips, etc.):
```js
alert(t("t_confirm_move_file"), {old_path, new_path})
```

#### `th(key, insertions?)` - HTML Content
Use for content that contains HTML markup or Preact elements:
```js
th("t_newnotebook")  // Contains <strong> tags
th("t_welcome_to_pluto", { pluto: html`<img src=${url_logo_big} />` })

html`
<h2>${th("t_something_with_a_number", { count: 5 })}</h2>
`

```
### When to Use Each Function
- **`t()`**: Tooltips, button titles, aria-labels, plain text content
- **`th()`**: Any content with HTML markup, or when interpolating Preact elements.

## Language Files

### Location
Language files are stored in `frontend/lang/` as JSON files:
- `english.json` (fallback language)
- `nederlands_nl.json`
- Add new languages following the pattern: `{language}.json`

### JSON Structure
```json
{
    "t_simple_key": "Simple translation",
    "t_html_content": "Text with <strong>HTML</strong> markup",
    "t_with_interpolation": "Welcome to {{appname}}",
    "t_pluralized": "Delete {{count}} items",
    "t_pluralized_one": "Delete this item"
}
```


## Best Practices

0. **Always use the `t_` prefix** for all keys.
1. **Always localize user-facing strings** - Never hardcode English text
2. **Use descriptive keys** - Keys should indicate context and usage
3. **Consistent interpolation** - Use `{{variable}}` syntax for placeholders
4. **HTML-safe content** - Use `th()` for any content containing markup
5. **Pluralization** - Use separate keys for singular/plural forms when needed
6. **Fallback coverage** - Ensure all keys exist in `english.json` (fallback language)
7. **Complete sentences** - Always localize complete sentences, not just parts of them.

## Examples

### Simple text:
```js
// ✅ Good
title={t("t_remove_from_recent_notebooks")}

// ❌ Bad
title="Remove from recent notebooks"
```

### HTML content:
```js
// ✅ Good
${th("t_newnotebook")}  // "Create a <strong>new notebook</strong>"

// ❌ Bad  
html`Create a <strong>new notebook</strong>`
```

### With interpolation:
```js
// ✅ Good
${th("t_welcome_to_pluto", { pluto: html`<img src=${logo} />` })}

// ❌ Bad
html`Welcome to <img src=${logo} />`
```

### Complete sentences:
```js
// ✅ Good
html`
<h2>${th("t_cells_deleted", { count: n })}</h2>
`

// ❌ Bad
<h2>${n}${th("t_cells_deleted")}</h2>
```

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.