agentleFS
aspose-cellsaspose-cells/agentic-net-examples/globalization-and-localization/AGENTS.md

agentic-net-examples / globalization-and-localization

AGENTS.md1 starsChanged 2 months agoMITView on GitHub

Create deterministic, culture-aware Aspose.Cells for .NET examples for localized numbers, dates, calendars, formulas, Boolean/error labels, subtotal/pivot labels, chart text, and regional workbook behavior. Follow ../AGENTS.md. Use format-cells when only a format string changes, and manage-formulas when formula structure rather than language/culture is primary. When culture must influence workbook parsing or rendering, configure the documented workbook/load setting rather than creating an unused CultureInfo object. Each example must identify locale, input representation, stored type, display/formula behavior, output, and expected localized result. Metadata…

The file

We split this AGENTS.md 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. Very specific:

    Create deterministic, culture-aware Aspose.Cells for .NET examples for localized numbers, dates, calendars, formulas, Boolean/error labels, …

    line 19
  2. Very specific:

    Use format-cells when only a format string changes, and manage-formulas when formula structure rather than language/culture is primary.

    line 21
  3. Distinctive:

    Keep invariant formula syntax and localized formula syntax distinct.

    line 38
  4. Distinctive:

    Use valid BCP 47/.NET culture identifiers and deterministic dates away from ambiguous boundaries unless testing boundaries.

    line 40
  5. Distinctive:

    Do not claim that changing culture translates arbitrary workbook text.

    line 42
  6. Very specific:

    When culture must influence workbook parsing or rendering, configure the documented workbook/load setting rather than creating an unused …

    line 61
  7. Distinctive:

    Keep mappings case-aware according to Excel semantics.

    line 67
  8. Distinctive:

    Never perform network calls or workbook mutation inside localization callbacks.

    line 68
  9. Very specific:

    Test under an explicitly configured culture, compare typed values separately from display text, save/reopen, and render when visual labels …

    line 77

≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.md 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
AGENTS.md

Globalization and Localization Agent Instructions

Mission and scope

Create deterministic, culture-aware Aspose.Cells for .NET examples for localized numbers, dates, calendars, formulas, Boolean/error labels, subtotal/pivot labels, chart text, and regional workbook behavior. Follow ../AGENTS.md.

Use format-cells when only a format string changes, and manage-formulas when formula structure rather than language/culture is primary.

Canonical model

ConcernPreferred mechanism
Parse/load with a cultureVersion-supported LoadOptions culture/region settings
Workbook regionWorkbook.Settings.Region or package-supported culture setting
Custom labels/function namesDerive from GlobalizationSettings and override documented members
Localized formula textCell.FormulaLocal when appropriate and supported
Culture-specific displayTyped values plus Style.Custom/number formats
Japanese era/calendarExplicit CultureInfo/calendar APIs and verified Aspose helpers

Hard rules

  • Set culture explicitly; never rely on the developer machine's current culture.
  • Store dates and numbers as typed values, not preformatted localized strings, unless parsing text is the objective.
  • Keep invariant formula syntax and localized formula syntax distinct.
  • Save and restore thread culture if an example changes it.
  • Use valid BCP 47/.NET culture identifiers and deterministic dates away from ambiguous boundaries unless testing boundaries.
  • Explain whether localization affects stored values, display formats, formula names, or rendered labels.
  • Do not claim that changing culture translates arbitrary workbook text.

Canonical culture-safe pattern

CultureInfo culture = CultureInfo.GetCultureInfo("fr-FR");
Workbook workbook = new Workbook();
workbook.Settings.CultureInfo = culture;
Worksheet worksheet = workbook.Worksheets[0];

worksheet.Cells["A1"].PutValue(new DateTime(2026, 6, 29));
Style style = worksheet.Cells["A1"].GetStyle();
style.Custom = "dd mmmm yyyy";
worksheet.Cells["A1"].SetStyle(style);

workbook.Save("localized-workbook.xlsx");
Console.WriteLine(culture.Name);

When culture must influence workbook parsing or rendering, configure the documented workbook/load setting rather than creating an unused CultureInfo object.

Custom globalization settings

  • Override only documented methods needed by the scenario.
  • Provide a deterministic fallback for unknown labels or functions.
  • Keep mappings case-aware according to Excel semantics.
  • Never perform network calls or workbook mutation inside localization callbacks.
  • Unit-test each locale mapping and fallback.

Example contract

Each example must identify locale, input representation, stored type, display/formula behavior, output, and expected localized result. Metadata and opening comments must use canonical locale identifiers. Prefer filenames such as load-excel-with-french-culture.cs.

Validation and discoverability

Test under an explicitly configured culture, compare typed values separately from display text, save/reopen, and render when visual labels are claimed. Restore global/thread state in finally.

Target one intent such as "format Excel dates for French culture" or "localize Excel formula names in C#." Reject examples that depend silently on installed Excel language packs, compare culture-sensitive strings without a declared culture, or alter process-wide culture without cleanup.

Related knowledge

Definition of done

The example is done when locale, stored value, display/formula effect, fallback behavior, process-state cleanup, and expected output are explicit and verified.

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.