> For the complete documentation index, see [llms.txt](https://docs.babelshark.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.babelshark.net/setup/scopes.md).

# Scopes

Scope is an area which contains one or more source strings, making them unique from other scopes.

### Example

Imagine we have a word *"General"*. It may mean:

* the "the entry of Settings menu"&#x20;
* or "player's military rank".

It may (and will) be localised differently in some languages.

### Scope usage

To distinguish different localizations of the same word you can specify a scope:

```html
<ul class="menu" data-bs-scope="Settings menu">
  <li class="__">General</li>
</ul>
```

and

```html
<div class="player-info" data-bs-scope="Player info">
  Your rank: <span class="__">General</span>
</ul>
```

This will create two different scopes for "General" string, and allow it to be localised properly.

You and your team members (including proofreaders) will clearly see the scope in source strings list.

### Scope size

You can set scope directly on a source string:

```html
<span data-bs-scope="Player info">General</span>
```

or some container element:

```html
<div class="page-section" data-bs-scope="Player info">
```

or even on a whole page:

```html
<body data-bs-scope="Player info">
```

### Nesting and default scope

Scopes do not stack. Each nested scope cancels the outer scope and creates its own scope.

You can reset any item to default ("*none"*) scope by specifying an empty attribute. You may need it for strings which meaning is generic:&#x20;

```html
<div class="new-user-dialog" data-bs-scope="New user">
  ...
  <button class="__" data-bs-scope="">Cancel</button>
</div>
```

### Recommendation

It is not recommended to create an own scope for each and every page. Average project has much more generic terms and strings.

But if you face a problem with an ambiguous localisation, you can add a scope at any time.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.babelshark.net/setup/scopes.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
