PHPackages                             pedro-mendonca/convert-pt-ao90 - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Localization &amp; i18n](/categories/localization)
4. /
5. pedro-mendonca/convert-pt-ao90

ActiveLibrary[Localization &amp; i18n](/categories/localization)

pedro-mendonca/convert-pt-ao90
==============================

Open source language tool to convert Portuguese to AO90.

1.3.4(7mo ago)75.5k[2 PRs](https://github.com/pedro-mendonca/Convert-PT-AO90/pulls)GPL-3.0-or-laterPHPPHP ^7.4 || ^8.0CI passing

Since Oct 15Pushed 2w ago1 watchersCompare

[ Source](https://github.com/pedro-mendonca/Convert-PT-AO90)[ Packagist](https://packagist.org/packages/pedro-mendonca/convert-pt-ao90)[ GitHub Sponsors](https://github.com/sponsors/pedro-mendonca)[ RSS](/packages/pedro-mendonca-convert-pt-ao90/feed)WikiDiscussions main Synced 2w ago

READMEChangelog (10)Dependencies (8)Versions (31)Used By (0)

[![](https://repository-images.githubusercontent.com/304012585/a73f6380-0fa2-11eb-86ad-933e046ae964)](https://repository-images.githubusercontent.com/304012585/a73f6380-0fa2-11eb-86ad-933e046ae964)

Convert PT AO90
===============

[](#convert-pt-ao90)

[![Packagist version](https://camo.githubusercontent.com/09846a85ec38af7590aaf698c12ec6d2d624bb54b6d3d99829533c454a11ac70/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f706564726f2d6d656e646f6e63612f436f6e766572742d50542d414f39303f6c6162656c3d5061636b6167697374)](https://packagist.org/packages/pedro-mendonca/convert-pt-ao90)[![Release Date](https://camo.githubusercontent.com/b8a4c03404153871eebcad03014fb348b41c5aa4523eb1428525c6c0c0739787/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652d646174652f706564726f2d6d656e646f6e63612f436f6e766572742d50542d414f39303f6c6162656c3d52656c6561736525323044617465)](https://github.com/pedro-mendonca/Convert-PT-AO90/releases)[![License](https://camo.githubusercontent.com/1b56c9eeafdea511b0ccac082a7e5868a30456311829d95039300d45a850b48a/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f706564726f2d6d656e646f6e63612f436f6e766572742d50542d414f39303f6c6162656c3d4c6963656e7365)](https://opensource.org/licenses/GPL-3.0)[![Packagist PHP Version Support](https://camo.githubusercontent.com/54973241f626bc4091ad5f645a7515f58f14c569b99514ca2d2dbe5ed00447a4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f706564726f2d6d656e646f6e63612f636f6e766572742d70742d616f39303f6c6162656c3d5048502532305265717569726564266c6f676f3d504850266c6f676f436f6c6f723d7768697465)](https://github.com/pedro-mendonca/Convert-PT-AO90/actions/workflows/php-compatibility.yml)[![Sponsor](https://camo.githubusercontent.com/35d54e3bc4642d258f0afc03ee3201c7cfbf32cbbdede6c8b287e480b7b969e0/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4769744875622d25463025394625413425384425323053706f6e736f722d6561346161613f6c6f676f3d676974687562)](https://github.com/sponsors/pedro-mendonca)

[![Test](https://github.com/pedro-mendonca/Convert-PT-AO90/actions/workflows/test.yml/badge.svg)](https://github.com/pedro-mendonca/Convert-PT-AO90/actions/workflows/test.yml)[![Coding Standards](https://github.com/pedro-mendonca/Convert-PT-AO90/actions/workflows/coding-standards.yml/badge.svg)](https://github.com/pedro-mendonca/Convert-PT-AO90/actions/workflows/coding-standards.yml)[![Static Analysis](https://github.com/pedro-mendonca/Convert-PT-AO90/actions/workflows/static-analysis.yml/badge.svg)](https://github.com/pedro-mendonca/Convert-PT-AO90/actions/workflows/static-analysis.yml)[![Codacy Badge](https://camo.githubusercontent.com/099e0b102827c982d887c7f4611c56c32bf0abf7a6fadb0dfa745a19480a08ac/68747470733a2f2f6170692e636f646163792e636f6d2f70726f6a6563742f62616467652f47726164652f6362646335623233303539313433383739646536313532373530316261313939)](https://app.codacy.com/gh/pedro-mendonca/Convert-PT-AO90?utm_source=github.com&utm_medium=referral&utm_content=pedro-mendonca/Convert-PT-AO90&utm_campaign=Badge_Grade)

Description
-----------

[](#description)

Language tool to convert text according to the [Portuguese Language Orthographic Agreement of 1990](https://en.wikipedia.org/wiki/Portuguese_Language_Orthographic_Agreement_of_1990) ([PT AO90](https://pt.wikipedia.org/wiki/Acordo_Ortogr%C3%A1fico_de_1990))

Installation instructions
-------------------------

[](#installation-instructions)

Installation can be done with [Composer](https://getcomposer.org/), by requiring this package as a dependency:

```
composer require pedro-mendonca/convert-pt-ao90

```

Make sure to include composer autoload in your project:

```
/**
 * Include Composer autoload.
 */
require 'vendor/autoload.php';
```

If you don't use [Composer](https://getcomposer.org/), you can **install manually** by downloading the [latest release](https://github.com/pedro-mendonca/Convert-PT-AO90/releases/latest), add it to your project folder and **include** the main file in your code:

```
/**
 * Include Convert-PT-AO90.
 */
require_once '/convert-pt-ao90/convert-pt-ao90.php';
```

Usage
-----

[](#usage)

Examples:

1. Convert text string:

    ```
    $text = 'Não me pélo pelo pêlo de quem pára para resistir!';
    $string_ao90 = Convert_PT_AO90\convert_pt_ao90( $text );
    echo $string_ao90;
    ```
2. See more examples and the complete replace pairs in the file [example.php](https://github.com/pedro-mendonca/Convert-PT-AO90/blob/main/example.php).

Changelog
---------

[](#changelog)

### 1.3.4

[](#134)

- Harden type checking of replace pairs.
- Update dependencies.
- Tested up to PHP 8.4 and 8.5.

### 1.3.3

[](#133)

- Fix converting strings with trailing space returning null.
- Update dependencies.
- Add more test cases.
- Tested up to PHP 8.3.

### 1.3.2

[](#132)

- Fix variable type error.
- Add some more replace pairs.
- Rebuild replace pairs.
- Update dependencies.
- Tested only on supported PHP versions (7.4+).

### 1.3.1

[](#131)

- Fix matching for words with exact case on the replace pairs.

### 1.3.0

[](#130)

- Rebuild replace pairs with half the size.
- Improve performance by using only lowercase replace pairs.
- Fix matching words starting with an accented vowel.
- Remove wrong replace pairs about cardinal points (lowercased since 1945).
- Add some more replace pairs.
- Update dependencies.

### 1.2.3

[](#123)

- Rebuild replace pairs.

### 1.2.2

[](#122)

- Fix sentence boundary issue with HTML after ending.
- Add sentence boundary after two new lines.
- Add more tests: new lines followed by HTML.

### 1.2.1

[](#121)

- Fix JSON path issue when used as dependency.

### 1.2.0

[](#120)

- Rebuild code to allow a detailed control over sentence and word boundaries.
- Fix problem of partial find+replace of words, now only whole words can be converted.
- Remove temporary bug fix of partial find+replace (acto-&gt;ato).
- Update main replace pairs library.
- Add more custom replace pairs rules.
- Rebuild and add both replace pairs JSON, minified and source (pretty).
- Add more tests for many different types of texts: Multiline, HTML, multiple sentences, etc.

### 1.1.0

[](#110)

- Use a pre-built Replace Pairs JSON file to improve performance (5x faster).
- Simplify Replace Pairs data.
- Bump minimum PHP to 7.2.
- Add Tests! [Run the Convert PT AO90](https://github.com/pedro-mendonca/Convert-PT-AO90/actions/workflows/test.yml) against a [set of text strings](https://github.com/pedro-mendonca/Convert-PT-AO90/blob/main/tests/convert-pt-ao90-test.php#L26:L70) with expected results.
- Add some custom replace pairs rules.

### 1.0.3

[](#103)

- Move CI to GitHub Actions.
- Bump PHPStan Level to 9.
- Add Markdownlint and PHPMD.
- Fix coding standards.

### 1.0.2

[](#102)

- Fix autoload and library path for package installed as composer dependency.

### 1.0.1

[](#101)

- Add Composer install support.

### 1.0.0

[](#100)

- Initial release.

###  Health Score

51

—

FairBetter than 95% of packages

Maintenance82

Actively maintained with recent releases

Popularity27

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity71

Established project with proven stability

 Bus Factor1

Top contributor holds 61.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~158 days

Recently: every ~310 days

Total

13

Last Release

227d ago

PHP version history (4 changes)1.0.1PHP &gt;=5.6

1.1.0PHP &gt;=7.2

1.3.2PHP &gt;=7.4

1.3.4PHP ^7.4 || ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/ec6a49f01b047a37da956a20ebc3f4097c99fc4f559c9be8fecce6b38a758acd?d=identicon)[pedromendonca](/maintainers/pedromendonca)

---

Top Contributors

[![pedro-mendonca](https://avatars.githubusercontent.com/u/7371591?v=4)](https://github.com/pedro-mendonca "pedro-mendonca (498 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (314 commits)")[![codacy-badger](https://avatars.githubusercontent.com/u/23704769?v=4)](https://github.com/codacy-badger "codacy-badger (1 commits)")

---

Tags

acordo-ortograficoacordo-ortografico-1990ao90conversionconverterhacktoberfesthacktoberfest2020languagephpstanportuguesetool

### Embed Badge

![Health badge](/badges/pedro-mendonca-convert-pt-ao90/health.svg)

```
[![Health](https://phpackages.com/badges/pedro-mendonca-convert-pt-ao90/health.svg)](https://phpackages.com/packages/pedro-mendonca-convert-pt-ao90)
```

###  Alternatives

[smarty-gettext/smarty-gettext

Gettext plugin enabling internationalization in Smarty Package files

752.5M8](/packages/smarty-gettext-smarty-gettext)[devaslanphp/auto-translate

Auto generate translation JSON files

6627.3k](/packages/devaslanphp-auto-translate)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
