Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change BrazilianPortugueseOrdinalizer to PortugueseOrdinalizer #416

Merged
merged 5 commits into from
Jun 7, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion release_notes.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
###In Development

- [#416](https://github.com/MehdiK/Humanizer/pull/416): Change BrazilianPortugueseOrdinalizer to PortugueseOrdinalizer

[Commits](https://github.com/MehdiK/Humanizer/compare/v1.35.0...master)

###v1.35.0 - 2015-03-29
Expand Down
4 changes: 2 additions & 2 deletions src/Humanizer/Configuration/OrdinalizerRegistry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ public OrdinalizerRegistry() : base(new DefaultOrdinalizer())
Register("en", new EnglishOrdinalizer());
Register("es", new SpanishOrdinalizer());
Register("it", new ItalianOrdinalizer());
Register("pt-BR", new BrazilianPortugueseOrdinalizer());
Register("pt", new PortugueseOrdinalizer());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this not going to break exiting pt-BR users?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. pt-PT and pt-BR is the same language, similar to en-US and en-GB. They have some particular differences in some cases, which isn't this case .
When the sub-set of the language is irrelevant we usually use just "pt" or just "en".
To be consistent I've changed the BrazilianPortugueseOrdinalizer to PortugueseOrdinalizer because the language is Portuguese, there aren't such thing as Brazilian-Portuguese language.

Register("ru", new RussianOrdinalizer());
Register("tr", new TurkishOrdinalizer());
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace Humanizer.Localisation.Ordinalizers
{
internal class BrazilianPortugueseOrdinalizer : DefaultOrdinalizer
internal class PortugueseOrdinalizer : DefaultOrdinalizer
{
public override string Convert(int number, string numberString)
{
Expand All @@ -19,4 +19,4 @@ public override string Convert(int number, string numberString, GrammaticalGende
return numberString + "º";
}
}
}
}
234 changes: 234 additions & 0 deletions src/Humanizer/Properties/Resources.pt.resx
Original file line number Diff line number Diff line change
@@ -0,0 +1,234 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema

Version 2.0

The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.

Example:

... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>

There are any number of "resheader" rows that contain simple
name/value pairs.

Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.

The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:

Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.

mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.

mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.

mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="DateHumanize_SingleSecondAgo" xml:space="preserve">
<value>um segundo atrás</value>
</data>
<data name="DateHumanize_SingleSecondFromNow" xml:space="preserve">
<value>em um segundo</value>
</data>
<data name="DateHumanize_MultipleSecondsAgo" xml:space="preserve">
<value>{0} segundos atrás</value>
</data>
<data name="DateHumanize_MultipleSecondsFromNow" xml:space="preserve">
<value>em {0} segundos</value>
</data>
<data name="DateHumanize_SingleMinuteAgo" xml:space="preserve">
<value>um minuto atrás</value>
</data>
<data name="DateHumanize_SingleMinuteFromNow" xml:space="preserve">
<value>em um minuto</value>
</data>
<data name="DateHumanize_MultipleMinutesAgo" xml:space="preserve">
<value>{0} minutos atrás</value>
</data>
<data name="DateHumanize_MultipleMinutesFromNow" xml:space="preserve">
<value>em {0} minutos</value>
</data>
<data name="DateHumanize_SingleHourAgo" xml:space="preserve">
<value>uma hora atrás</value>
</data>
<data name="DateHumanize_SingleHourFromNow" xml:space="preserve">
<value>em uma hora</value>
</data>
<data name="DateHumanize_MultipleHoursAgo" xml:space="preserve">
<value>{0} horas atrás</value>
</data>
<data name="DateHumanize_MultipleHoursFromNow" xml:space="preserve">
<value>em {0} horas</value>
</data>
<data name="DateHumanize_SingleDayAgo" xml:space="preserve">
<value>ontem</value>
</data>
<data name="DateHumanize_SingleDayFromNow" xml:space="preserve">
<value>amanhã</value>
</data>
<data name="DateHumanize_MultipleDaysAgo" xml:space="preserve">
<value>{0} dias atrás</value>
</data>
<data name="DateHumanize_MultipleDaysFromNow" xml:space="preserve">
<value>em {0} dias</value>
</data>
<data name="DateHumanize_SingleMonthAgo" xml:space="preserve">
<value>um mês atrás</value>
</data>
<data name="DateHumanize_SingleMonthFromNow" xml:space="preserve">
<value>em um mês</value>
</data>
<data name="DateHumanize_MultipleMonthsFromNow" xml:space="preserve">
<value>em {0} meses</value>
</data>
<data name="DateHumanize_MultipleMonthsAgo" xml:space="preserve">
<value>{0} meses atrás</value>
</data>
<data name="DateHumanize_SingleYearAgo" xml:space="preserve">
<value>um ano atrás</value>
</data>
<data name="DateHumanize_SingleYearFromNow" xml:space="preserve">
<value>em um ano</value>
</data>
<data name="DateHumanize_MultipleYearsAgo" xml:space="preserve">
<value>{0} anos atrás</value>
</data>
<data name="DateHumanize_MultipleYearsFromNow" xml:space="preserve">
<value>em {0} anos</value>
</data>
<data name="TimeSpanHumanize_MultipleDays" xml:space="preserve">
<value>{0} dias</value>
</data>
<data name="TimeSpanHumanize_MultipleHours" xml:space="preserve">
<value>{0} horas</value>
</data>
<data name="TimeSpanHumanize_MultipleMilliseconds" xml:space="preserve">
<value>{0} milisegundos</value>
</data>
<data name="TimeSpanHumanize_MultipleMinutes" xml:space="preserve">
<value>{0} minutos</value>
</data>
<data name="TimeSpanHumanize_MultipleSeconds" xml:space="preserve">
<value>{0} segundos</value>
</data>
<data name="TimeSpanHumanize_SingleDay" xml:space="preserve">
<value>1 dia</value>
</data>
<data name="TimeSpanHumanize_SingleHour" xml:space="preserve">
<value>1 hora</value>
</data>
<data name="TimeSpanHumanize_SingleMillisecond" xml:space="preserve">
<value>1 milisegundo</value>
</data>
<data name="TimeSpanHumanize_SingleMinute" xml:space="preserve">
<value>1 minuto</value>
</data>
<data name="TimeSpanHumanize_SingleSecond" xml:space="preserve">
<value>1 segundo</value>
</data>
<data name="TimeSpanHumanize_Zero" xml:space="preserve">
<value>sem horário</value>
</data>
<data name="TimeSpanHumanize_MultipleWeeks" xml:space="preserve">
<value>{0} semanas</value>
</data>
<data name="TimeSpanHumanize_SingleWeek" xml:space="preserve">
<value>1 semana</value>
</data>
<data name="DateHumanize_Now" xml:space="preserve">
<value>agora</value>
</data>
</root>