diff options
author | Ken Moore <ken@ixsystems.com> | 2017-06-19 19:08:23 -0400 |
---|---|---|
committer | Ken Moore <ken@ixsystems.com> | 2017-06-19 19:08:23 -0400 |
commit | e4351bd7dae86ffa7ff4086b4abb270e529c5f4b (patch) | |
tree | 667d5b563a7d563222da504b7a112837f78a6626 | |
parent | Fix the migration routine when moving from the "default" monitor ID (vesa, sc... (diff) | |
parent | Translated using Weblate (lumina_DESKTOP@lt (generated)) (diff) | |
download | lumina-e4351bd7dae86ffa7ff4086b4abb270e529c5f4b.tar.gz lumina-e4351bd7dae86ffa7ff4086b4abb270e529c5f4b.tar.bz2 lumina-e4351bd7dae86ffa7ff4086b4abb270e529c5f4b.zip |
Merge branch 'master' of github.com:trueos/lumina
6 files changed, 247 insertions, 13 deletions
diff --git a/src-qt5/core/lumina-desktop/i18n/lumina-desktop_lt.ts b/src-qt5/core/lumina-desktop/i18n/lumina-desktop_lt.ts index 7cf83ee2..1869e3e0 100644 --- a/src-qt5/core/lumina-desktop/i18n/lumina-desktop_lt.ts +++ b/src-qt5/core/lumina-desktop/i18n/lumina-desktop_lt.ts @@ -261,12 +261,12 @@ <message> <location filename="../BootSplash.cpp" line="63"/> <source>One with the law is a majority.</source> - <translation type="unfinished"></translation> + <translation>Žmogus su įstatymu yra dauguma.</translation> </message> <message> <location filename="../BootSplash.cpp" line="65"/> <source>Don't expect to build up the weak by pulling down the strong.</source> - <translation type="unfinished"></translation> + <translation>Nesitikėk padrąsinti silpnus, žemindamas stiprius.</translation> </message> <message> <location filename="../BootSplash.cpp" line="67"/> @@ -276,7 +276,7 @@ <message> <location filename="../BootSplash.cpp" line="69"/> <source>Duty is not collective; it is personal.</source> - <translation type="unfinished"></translation> + <translation>Pareiga nėra kolektyvinis dalykas, tai yra asmeninis dalykas.</translation> </message> <message> <location filename="../BootSplash.cpp" line="71"/> @@ -316,7 +316,7 @@ <message> <location filename="../BootSplash.cpp" line="85"/> <source>It does not matter how slowly you go as long as you do not stop.</source> - <translation type="unfinished"></translation> + <translation>Nėra svarbu kaip lėtai judi tol, kol nenustoji judėjęs.</translation> </message> <message> <location filename="../BootSplash.cpp" line="87"/> @@ -326,17 +326,17 @@ <message> <location filename="../BootSplash.cpp" line="89"/> <source>Remember no one can make you feel inferior without your consent.</source> - <translation>Prisiminkite, niekas negali jūsų priversti jaustis menkesniais, be jūsų pačių sutikimo.</translation> + <translation>Prisimink, niekas be tavo paties sutikimo negali priversti tavęs jaustis menkesniu.</translation> </message> <message> <location filename="../BootSplash.cpp" line="91"/> <source>It’s not the years in your life that count. It’s the life in your years.</source> - <translation type="unfinished"></translation> + <translation>Svarbu ne nugyventų gyvenimo metų skaičius, o gyvenimas nugyventuose metuose.</translation> </message> <message> <location filename="../BootSplash.cpp" line="93"/> <source>Either write something worth reading or do something worth writing.</source> - <translation>Arba parašykite ką nors apie ką verta skaityti, arba padarykite ką nors apie ką verta rašyti.</translation> + <translation>Arba parašyk ką nors apie ką verta skaityti, arba padaryk ką nors apie ką verta rašyti.</translation> </message> <message> <location filename="../BootSplash.cpp" line="95"/> @@ -361,7 +361,7 @@ <message> <location filename="../BootSplash.cpp" line="103"/> <source>Do, or do not. There is no 'try'.</source> - <translation type="unfinished"></translation> + <translation>Daryti arba nedaryti. Nėra "bandyti".</translation> </message> <message> <location filename="../BootSplash.cpp" line="105"/> @@ -376,7 +376,7 @@ <message> <location filename="../BootSplash.cpp" line="109"/> <source>Black holes are where God divided by zero.</source> - <translation type="unfinished"></translation> + <translation>Juodosios skylės yra ten, kur Dievas padalijo iš nulio.</translation> </message> <message> <location filename="../BootSplash.cpp" line="111"/> diff --git a/src-qt5/desktop-utils/lumina-textedit/syntax_rules/go.syntax b/src-qt5/desktop-utils/lumina-textedit/syntax_rules/go.syntax new file mode 100644 index 00000000..3eff96c1 --- /dev/null +++ b/src-qt5/desktop-utils/lumina-textedit/syntax_rules/go.syntax @@ -0,0 +1,49 @@ +# Syntax support file for the Lumina Text Editor +# =================================== +# Go language support rules +# Written by Zackary Welch <zwelch@ixsystems.com> +# Released under the 2-clause BSD license +# =================================== + +{ + "meta": { + "name": "Go", + "file_suffix": ["go"] + }, + "format": { + "line_wrap": false, + "highlight_whitespace_eol" : false + }, + "rules": [{ + "name": "keywords", + "words": ["break", "default", "func", "interface", "select", "case", "defer", "go", "map", "struct", "chan", "else", "goto", "package", "switch", "const", "fallthrough", "if", "range", "type", "continue", "for", "import", "return", "var", "uint32", "uint64", "float32", "float64"], + "foreground": "colors/keyword" + }, + { + "name": "single-line comment", + "regex": "//[^\n]*", + "foreground": "colors/comment" + }, + { + "name": "multi-line comment", + "regex_start": "/\\*", + "regex_end": "\\*/", + "foreground": "colors/comment" + }, + { + "name": "numbers", + "regex": "\\b[0-9]+\\.?[0-9]*\\b|[0-9]+e[\\+\\-]?[0-9]+", + "foreground": "colors/altkeyword" + }, + { + "name": "function names", + "regex": "\\b[A-Za-z0-9_]+(?=\\()", + "foreground": "colors/class" + }, + { + "name" : "text", + "regex": "\"[^\"\\\\]*(\\\\(.|\\n)[^\"\\\\]*)*\"|'[^'\\\\]*(\\\\(.|\\n)[^'\\\\]*)*'", + "foreground" : "colors/text" + } + ] +} diff --git a/src-qt5/desktop-utils/lumina-textedit/syntax_rules/javascript.syntax b/src-qt5/desktop-utils/lumina-textedit/syntax_rules/javascript.syntax index bb179be4..02e1092a 100644 --- a/src-qt5/desktop-utils/lumina-textedit/syntax_rules/javascript.syntax +++ b/src-qt5/desktop-utils/lumina-textedit/syntax_rules/javascript.syntax @@ -32,7 +32,7 @@ }, { "name": "numbers", - "regex": "\\b([0-9]+[\\.]?[0-9]?)+\\b", + "regex": "\\b[0-9]+\\.?[0-9]*\\b", "foreground": "colors/altkeyword" }, { diff --git a/src-qt5/desktop-utils/lumina-textedit/syntax_rules/json.syntax b/src-qt5/desktop-utils/lumina-textedit/syntax_rules/json.syntax index fdca7211..ab67d384 100644 --- a/src-qt5/desktop-utils/lumina-textedit/syntax_rules/json.syntax +++ b/src-qt5/desktop-utils/lumina-textedit/syntax_rules/json.syntax @@ -8,7 +8,7 @@ { "meta": { "name": "JSON", - "file_suffix": ["json"] + "file_suffix": ["json", "syntax"] }, "format": { "line_wrap": false, diff --git a/src-qt5/desktop-utils/lumina-textedit/syntax_rules/php.syntax b/src-qt5/desktop-utils/lumina-textedit/syntax_rules/php.syntax index 1aa906d4..15f6e2a5 100644 --- a/src-qt5/desktop-utils/lumina-textedit/syntax_rules/php.syntax +++ b/src-qt5/desktop-utils/lumina-textedit/syntax_rules/php.syntax @@ -16,7 +16,7 @@ }, "rules": [{ "name": "keywords", - "words": ["private", "public", "class", "function", "const", "return", "if", "else", "bool", "abstract", "and", "as", "break", "case", "catch", "const", "do", "echo", "elseif", "default", "endif", "endfor", "final", "for", "foreach", "extends", "global", "include", "interface", "new", "or", "protected", "require", "static", "switch", "throw", "try", "use", "var", "while", "xor"], + "words": ["private", "public", "class", "function", "const", "return", "if", "else", "bool", "abstract", "and", "as", "break", "case", "catch", "const", "do", "echo", "int", "elseif", "default", "endif", "endfor", "final", "for", "foreach", "extends", "global", "include", "interface", "new", "or", "protected", "require", "static", "switch", "throw", "try", "use", "var", "while", "xor"], "foreground": "colors/keyword" }, { @@ -32,7 +32,7 @@ }, { "name": "numbers", - "regex": "\\b([0-9]+[\\.]?[0-9]?)+\\b", + "regex": "\\b[0-9]+\\.?[0-9]*\\b", "foreground": "colors/altkeyword" }, { diff --git a/src-qt5/desktop-utils/lumina-textedit/tests/test.go b/src-qt5/desktop-utils/lumina-textedit/tests/test.go new file mode 100644 index 00000000..0ae9b2dc --- /dev/null +++ b/src-qt5/desktop-utils/lumina-textedit/tests/test.go @@ -0,0 +1,185 @@ +// Source: https://github.com/golang/geo +/* +Copyright 2014 Google Inc. All rights reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package r3 + +import ( + "fmt" + "math" + + "github.com/golang/geo/s1" +) + +// Vector represents a point in ℝ³. +type Vector struct { + X, Y, Z float64 +} + +// ApproxEqual reports whether v and ov are equal within a small epsilon. +func (v Vector) ApproxEqual(ov Vector) bool { + const epsilon = 1e-16 + return math.Abs(v.X-ov.X) < epsilon && math.Abs(v.Y-ov.Y) < epsilon && math.Abs(v.Z-ov.Z) < epsilon +} + +func (v Vector) String() string { return fmt.Sprintf("(%0.24f, %0.24f, %0.24f)", v.X, v.Y, v.Z) } + +// Norm returns the vector's norm. +func (v Vector) Norm() float64 { return math.Sqrt(v.Dot(v)) } + +// Norm2 returns the square of the norm. +func (v Vector) Norm2() float64 { return v.Dot(v) } + +// Normalize returns a unit vector in the same direction as v. +func (v Vector) Normalize() Vector { + if v == (Vector{0, 0, 0}) { + return v + } + return v.Mul(1 / v.Norm()) +} + +// IsUnit returns whether this vector is of approximately unit length. +func (v Vector) IsUnit() bool { + const epsilon = 5e-14 + return math.Abs(v.Norm2()-1) <= epsilon +} + +// Abs returns the vector with nonnegative components. +func (v Vector) Abs() Vector { return Vector{math.Abs(v.X), math.Abs(v.Y), math.Abs(v.Z)} } + +// Add returns the standard vector sum of v and ov. +func (v Vector) Add(ov Vector) Vector { return Vector{v.X + ov.X, v.Y + ov.Y, v.Z + ov.Z} } + +// Sub returns the standard vector difference of v and ov. +func (v Vector) Sub(ov Vector) Vector { return Vector{v.X - ov.X, v.Y - ov.Y, v.Z - ov.Z} } + +// Mul returns the standard scalar product of v and m. +func (v Vector) Mul(m float64) Vector { return Vector{m * v.X, m * v.Y, m * v.Z} } + +// Dot returns the standard dot product of v and ov. +func (v Vector) Dot(ov Vector) float64 { return v.X*ov.X + v.Y*ov.Y + v.Z*ov.Z } + +// Cross returns the standard cross product of v and ov. +func (v Vector) Cross(ov Vector) Vector { + return Vector{ + v.Y*ov.Z - v.Z*ov.Y, + v.Z*ov.X - v.X*ov.Z, + v.X*ov.Y - v.Y*ov.X, + } +} + +// Distance returns the Euclidean distance between v and ov. +func (v Vector) Distance(ov Vector) float64 { return v.Sub(ov).Norm() } + +// Angle returns the angle between v and ov. +func (v Vector) Angle(ov Vector) s1.Angle { + return s1.Angle(math.Atan2(v.Cross(ov).Norm(), v.Dot(ov))) * s1.Radian +} + +// Axis enumerates the 3 axes of ℝ³. +type Axis int + +// The three axes of ℝ³. +const ( + XAxis Axis = iota + YAxis + ZAxis +) + +// Ortho returns a unit vector that is orthogonal to v. +// Ortho(-v) = -Ortho(v) for all v. +func (v Vector) Ortho() Vector { + ov := Vector{0.012, 0.0053, 0.00457} + switch v.LargestComponent() { + case XAxis: + ov.Z = 1 + case YAxis: + ov.X = 1 + default: + ov.Y = 1 + } + return v.Cross(ov).Normalize() +} + +// LargestComponent returns the axis that represents the largest component in this vector. +func (v Vector) LargestComponent() Axis { + t := v.Abs() + + if t.X > t.Y { + if t.X > t.Z { + return XAxis + } + return ZAxis + } + if t.Y > t.Z { + return YAxis + } + return ZAxis +} + +// SmallestComponent returns the axis that represents the smallest component in this vector. +func (v Vector) SmallestComponent() Axis { + t := v.Abs() + + if t.X < t.Y { + if t.X < t.Z { + return XAxis + } + return ZAxis + } + if t.Y < t.Z { + return YAxis + } + return ZAxis +} + +// Cmp compares v and ov lexicographically and returns: +// +// -1 if v < ov +// 0 if v == ov +// +1 if v > ov +// +// This method is based on C++'s std::lexicographical_compare. Two entities +// are compared element by element with the given operator. The first mismatch +// defines which is less (or greater) than the other. If both have equivalent +// values they are lexicographically equal. +func (v Vector) Cmp(ov Vector) int { + if v.X < ov.X { + return -1 + } + if v.X > ov.X { + return 1 + } + + // First elements were the same, try the next. + if v.Y < ov.Y { + return -1 + } + if v.Y > ov.Y { + return 1 + } + + // Second elements were the same return the final compare. + if v.Z < ov.Z { + return -1 + } + if v.Z > ov.Z { + return 1 + } + + // Both are equal + return 0 +} |