Skip to content

Commit 238abb4

Browse files
committed
Version 1.5.0
Added German and French. Changed package name. Added getter for current language. Added changing language capability.
1 parent 9121f18 commit 238abb4

File tree

6 files changed

+142
-140
lines changed

6 files changed

+142
-140
lines changed

README.md

+6-7
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#Java 'TimeAgo' multilanguage library
1+
#Java 'TimeAgo' multilanguage library 1.5.0
22

33
This is a Java port of the [jquery-timeago](https://github.com/rmm5t/jquery-timeago) plug-in. Please visit the [jquery-timeago](http://rmm5t.github.com/jquery-timeago/) project page to read more about fuzzy timestamps.
44

@@ -19,7 +19,7 @@ This library is forked from Kevin Sawicki's 'java-timeago' to support more than
1919
<dependency>
2020
<groupId>com.github.Kinnonii</groupId>
2121
<artifactId>java-timeago</artifactId>
22-
<version>timeago-1.1.3</version>
22+
<version>1.5.0</version>
2323
</dependency>
2424
```
2525
###Gradle
@@ -31,7 +31,7 @@ repositories {
3131
}
3232
}
3333
dependencies {
34-
compile 'com.github.Kinnonii:java-timeago:timeago-1.1.3'
34+
compile 'com.github.Kinnonii:java-timeago:1.5.0'
3535
}
3636
```
3737

@@ -69,18 +69,17 @@ dependencies {
6969
}
7070
```
7171

72-
##Currently in work
73-
* Deutsch
74-
* French
7572

76-
It supports English, Spanish and Italian at the time.
73+
####It supports English, Spanish and Italian, French and German at the time.
7774

7875
##Usage
7976

8077
```java
8178
TimeAgo time = new TimeAgo('en'); //For English text.
8279
//TimeAgo time = new TimeAgo('it'); //For Italian text.
8380
//TimeAgo time = new TimeAgo('es'); //For Spanish text.
81+
//TimeAgo time = new TimeAgo('de'); //For German text.
82+
//TimeAgo time = new TimeAgo('fr'); //For French text.
8483

8584

8685
long current = System.currentTimeMillis();

timeago/pom.xml

+128-124
Original file line numberDiff line numberDiff line change
@@ -1,137 +1,141 @@
11
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
2-
<modelVersion>4.0.0</modelVersion>
2+
<modelVersion>4.0.0</modelVersion>
33

4-
<parent>
5-
<groupId>org.sonatype.oss</groupId>
6-
<artifactId>oss-parent</artifactId>
7-
<version>7</version>
8-
</parent>
4+
<parent>
5+
<groupId>org.sonatype.oss</groupId>
6+
<artifactId>oss-parent</artifactId>
7+
<version>7</version>
8+
</parent>
99

1010

11-
<groupId>com.github.Kinnonii</groupId>
12-
<artifactId>timeago</artifactId>
13-
<version>1.1.0</version>
11+
<groupId>com.github.Kinnonii</groupId>
12+
<artifactId>timeago</artifactId>
13+
<version>1.5.0</version>
1414

15-
<name>Time Ago</name>
16-
<description>Simple Java library for converting dates to time ago strings.</description>
17-
<url>http://www.github.com/kevinsawicki/java-timeago</url>
15+
<name>Multilanguage Time Ago</name>
16+
<description>Java library that converts dates into "Time ago" strings, supporting multiple languages..</description>
17+
<url>http://www.github.com/Kinnonii/Java-TimeAgo-Multilanguage</url>
1818

19-
<issueManagement>
20-
<url>https://github.com/kevinsawicki/java-timeago/issues</url>
21-
<system>GitHub Issues</system>
22-
</issueManagement>
19+
<issueManagement>
20+
<url>https://github.com/Kinnonii/Java-TimeAgo-Multilanguage/issues</url>
21+
<system>GitHub Issues</system>
22+
</issueManagement>
2323

24-
<licenses>
25-
<license>
26-
<name>MIT License</name>
27-
<url>http://www.opensource.org/licenses/mit-license.php</url>
28-
<distribution>repo</distribution>
29-
</license>
30-
</licenses>
24+
<licenses>
25+
<license>
26+
<name>MIT License</name>
27+
<url>http://www.opensource.org/licenses/mit-license.php</url>
28+
<distribution>repo</distribution>
29+
</license>
30+
</licenses>
3131

32-
<scm>
33-
<url>https://github.com/kinnonii/java-timeago</url>
34-
<connection>scm:git:git://github.com/kinnonii/java-timeago.git</connection>
35-
<developerConnection>scm:git:[email protected]:kinnonii/java-timeago.git</developerConnection>
36-
</scm>
32+
<scm>
33+
<url>https://github.com/kinnonii/java-timeago</url>
34+
<connection>scm:git:git://github.com/kinnonii/java-timeago.git</connection>
35+
<developerConnection>scm:git:[email protected]:kinnonii/java-timeago.git</developerConnection>
36+
</scm>
3737

38-
<developers>
39-
<developer>
40-
<email>kevinsawicki@gmail.com</email>
41-
<name>Kevin Sawicki</name>
42-
<url>https://github.com/kevinsawicki</url>
43-
<id>kevinsawicki</id>
44-
</developer>
45-
</developers>
38+
<developers>
39+
<developer>
40+
<email>pedro.a.1smr@gmail.com</email>
41+
<name>Pedro Adame Vergara</name>
42+
<url>https://github.com/KinnonII</url>
43+
<id>kinnonii</id>
44+
</developer>
45+
</developers>
4646

47-
<properties>
48-
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
49-
</properties>
47+
<properties>
48+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
49+
</properties>
5050

51-
<build>
52-
<resources>
53-
<resource>
54-
<directory>src/main/java</directory>
55-
<includes>
56-
<include>**/*.properties</include>
57-
</includes>
58-
</resource>
59-
</resources>
60-
<plugins>
61-
<plugin>
62-
<groupId>org.apache.maven.plugins</groupId>
63-
<artifactId>maven-compiler-plugin</artifactId>
64-
<configuration>
65-
<source>1.5</source>
66-
<target>1.5</target>
67-
</configuration>
68-
</plugin>
69-
<plugin>
70-
<groupId>org.apache.maven.plugins</groupId>
71-
<artifactId>maven-jar-plugin</artifactId>
72-
<configuration>
73-
<archive>
74-
<manifest>
75-
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
76-
<addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
77-
</manifest>
78-
</archive>
79-
</configuration>
80-
</plugin>
81-
<plugin>
82-
<groupId>org.apache.maven.plugins</groupId>
83-
<artifactId>maven-javadoc-plugin</artifactId>
84-
<executions>
85-
<execution>
86-
<goals>
87-
<goal>jar</goal>
88-
</goals>
89-
</execution>
90-
</executions>
91-
</plugin>
92-
<plugin>
93-
<groupId>org.apache.maven.plugins</groupId>
94-
<artifactId>maven-source-plugin</artifactId>
95-
<executions>
96-
<execution>
97-
<goals>
98-
<goal>jar</goal>
99-
</goals>
100-
</execution>
101-
</executions>
102-
</plugin>
103-
</plugins>
104-
</build>
51+
<build>
52+
<resources>
53+
<resource>
54+
<directory>src/main/java</directory>
55+
<includes>
56+
<include>**/*.properties</include>
57+
</includes>
58+
</resource>
59+
</resources>
60+
<plugins>
61+
<plugin>
62+
<groupId>org.apache.maven.plugins</groupId>
63+
<artifactId>maven-compiler-plugin</artifactId>
64+
<version>3.1</version>
65+
<configuration>
66+
<source>1.5</source>
67+
<target>1.5</target>
68+
</configuration>
69+
</plugin>
70+
<plugin>
71+
<groupId>org.apache.maven.plugins</groupId>
72+
<artifactId>maven-jar-plugin</artifactId>
73+
<version>2.4</version>
74+
<configuration>
75+
<archive>
76+
<manifest>
77+
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
78+
<addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
79+
</manifest>
80+
</archive>
81+
</configuration>
82+
</plugin>
83+
<plugin>
84+
<groupId>org.apache.maven.plugins</groupId>
85+
<artifactId>maven-javadoc-plugin</artifactId>
86+
<version>2.10.3</version>
87+
<executions>
88+
<execution>
89+
<goals>
90+
<goal>jar</goal>
91+
</goals>
92+
</execution>
93+
</executions>
94+
</plugin>
95+
<plugin>
96+
<groupId>org.apache.maven.plugins</groupId>
97+
<artifactId>maven-source-plugin</artifactId>
98+
<version>2.4</version>
99+
<executions>
100+
<execution>
101+
<goals>
102+
<goal>jar</goal>
103+
</goals>
104+
</execution>
105+
</executions>
106+
</plugin>
107+
</plugins>
108+
</build>
105109

106-
<profiles>
107-
<profile>
108-
<id>sign</id>
109-
<build>
110-
<plugins>
111-
<plugin>
112-
<groupId>org.apache.maven.plugins</groupId>
113-
<artifactId>maven-gpg-plugin</artifactId>
114-
<executions>
115-
<execution>
116-
<id>sign-artifacts</id>
117-
<phase>verify</phase>
118-
<goals>
119-
<goal>sign</goal>
120-
</goals>
121-
</execution>
122-
</executions>
123-
</plugin>
124-
</plugins>
125-
</build>
126-
</profile>
127-
</profiles>
110+
<profiles>
111+
<profile>
112+
<id>sign</id>
113+
<build>
114+
<plugins>
115+
<plugin>
116+
<groupId>org.apache.maven.plugins</groupId>
117+
<artifactId>maven-gpg-plugin</artifactId>
118+
<executions>
119+
<execution>
120+
<id>sign-artifacts</id>
121+
<phase>verify</phase>
122+
<goals>
123+
<goal>sign</goal>
124+
</goals>
125+
</execution>
126+
</executions>
127+
</plugin>
128+
</plugins>
129+
</build>
130+
</profile>
131+
</profiles>
128132

129-
<dependencies>
130-
<dependency>
131-
<groupId>junit</groupId>
132-
<artifactId>junit</artifactId>
133-
<version>4.8</version>
134-
<scope>test</scope>
135-
</dependency>
136-
</dependencies>
137-
</project>
133+
<dependencies>
134+
<dependency>
135+
<groupId>junit</groupId>
136+
<artifactId>junit</artifactId>
137+
<version>3.8.1</version>
138+
<scope>test</scope>
139+
</dependency>
140+
</dependencies>
141+
</project>

timeago/src/main/java/com/github/kevinsawicki/timeago/Messages.java renamed to timeago/src/main/java/com/github/kinnonii/timeago/Messages.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2011 Kevin Sawicki <kevinsawicki@gmail.com>
2+
* Copyright (c) 2015 Pedro Adame Vergara <pedro.a.1smr@gmail.com>
33
*
44
* Permission is hereby granted, free of charge, to any person obtaining a copy
55
* of this software and associated documentation files (the "Software"), to
@@ -19,7 +19,7 @@
1919
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
2020
* IN THE SOFTWARE.
2121
*/
22-
package com.github.kevinsawicki.timeago;
22+
package com.github.kinnonii.timeago;
2323

2424
import java.util.MissingResourceException;
2525
import java.util.ResourceBundle;
@@ -29,7 +29,7 @@
2929
*/
3030
public class Messages {
3131

32-
private static final String BUNDLE_NAME = "com.github.kevinsawicki.timeago.messages"; //$NON-NLS-1$
32+
private static final String BUNDLE_NAME = "com.github.kinnonii.timeago.messages"; //$NON-NLS-1$
3333

3434
private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
3535
.getBundle(BUNDLE_NAME);

timeago/src/main/java/com/github/kevinsawicki/timeago/TimeAgo.java renamed to timeago/src/main/java/com/github/kinnonii/timeago/TimeAgo.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2015 Pedro Adame <[email protected]>
2+
* Copyright (c) 2015 Pedro Adame Vergara <[email protected]>
33
*
44
* Permission is hereby granted, free of charge, to any person obtaining a copy
55
* of this software and associated documentation files (the "Software"), to
@@ -19,7 +19,7 @@
1919
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
2020
* IN THE SOFTWARE.
2121
*/
22-
package com.github.kevinsawicki.timeago;
22+
package com.github.kinnonii.timeago;
2323

2424
import java.text.MessageFormat;
2525
import java.util.Date;
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
package com.github.kevinsawicki.timeago.tests;
1+
package com.github.kinnonii.timeago.tests;
22
/*
3-
* Copyright (c) 2011 Kevin Sawicki <kevinsawicki@gmail.com>
3+
* Copyright (c) 2015 Pedro Adame Vergara <pedro.a.1smr@gmail.com>
44
*
55
* Permission is hereby granted, free of charge, to any person obtaining a copy
66
* of this software and associated documentation files (the "Software"), to
@@ -20,10 +20,9 @@
2020
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
2121
* IN THE SOFTWARE.
2222
*/
23-
import com.github.kevinsawicki.timeago.TimeAgo;
23+
import com.github.kinnonii.timeago.TimeAgo;
2424

2525
import java.text.MessageFormat;
26-
2726
import junit.framework.TestCase;
2827

2928
/**

0 commit comments

Comments
 (0)