├── .gitignore ├── CMakeLists.txt ├── COPYING ├── README.md ├── config.h.in ├── data ├── CMakeLists.txt └── skk.png ├── gui ├── CMakeLists.txt ├── adddictdialog.cpp ├── adddictdialog.h ├── adddictdialog.ui ├── common.h ├── dictmodel.cpp ├── dictmodel.h ├── dictwidget.cpp ├── dictwidget.h ├── dictwidget.ui ├── main.cpp ├── main.h ├── rulemodel.cpp ├── rulemodel.h └── skk-config.json ├── po ├── CMakeLists.txt ├── ca.po ├── da.po ├── de.po ├── fcitx-skk.pot ├── ja.po ├── ko.po ├── ru.po ├── tr.po ├── vi.po ├── zh_CN.po └── zh_TW.po └── src ├── CMakeLists.txt ├── dictionary_list.in ├── fcitx-skk.conf.in ├── fcitx-skk.desc ├── rule ├── skk-config.c ├── skk.c ├── skk.conf.in └── skk.h /.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | build*/ 3 | .* 4 | !.git* 5 | .git/ 6 | *.tar.* 7 | *.kdev4 8 | *.kate-swp 9 | *.orig 10 | tags 11 | astyle.sh 12 | cscope.* 13 | *.part 14 | *.so 15 | *.o 16 | *.a 17 | *.aux 18 | *.out 19 | *.log 20 | *.nav 21 | *.snm 22 | *.glo 23 | *.ist 24 | *.toc 25 | *.vrb 26 | *.bbl 27 | *.blg 28 | *.pre 29 | __pycache__/ 30 | *.pyc 31 | *.pya 32 | *.fdb_latexmk 33 | CMakeFiles 34 | Makefile 35 | CMakeCache.* 36 | *cmake_cache* 37 | cmake_install.cmake 38 | cmake-build-* 39 | -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.8.6) 2 | project(fcitx-skk) 3 | 4 | set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH}) 5 | option(ENABLE_QT "Enable Qt for GUI configuration" On) 6 | 7 | find_package(Fcitx 4.2.8 REQUIRED) 8 | include(FindPkgConfig) 9 | pkg_check_modules(LIBSKK "libskk" REQUIRED) 10 | _fcitx_add_uninstall_target() 11 | 12 | set(CMAKE_C_FLAGS "-Wall -Wextra -Wno-sign-compare -Wno-unused-parameter -fvisibility=hidden ${CMAKE_C_FLAGS}") 13 | set(CMAKE_CXX_FLAGS "-Wall -Wextra -Wno-sign-compare -Wno-unused-parameter -fvisibility=hidden ${CMAKE_CXX_FLAGS}") 14 | set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--as-needed ${CMAKE_SHARED_LINKER_FLAGS}") 15 | set(CMAKE_MODULE_LINKER_FLAGS "-Wl,--as-needed ${CMAKE_MODULE_LINKER_FLAGS}") 16 | 17 | if (NOT SKK_DEFAULT_PATH) 18 | set(SKK_DEFAULT_PATH "/usr/share/skk/SKK-JISYO.L") 19 | endif () 20 | 21 | if(NOT DEFINED LIB_INSTALL_DIR) 22 | set(LIB_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/lib) 23 | endif() 24 | 25 | if(NOT DEFINED LOCALEDIR) 26 | set(LOCALEDIR ${CMAKE_INSTALL_PREFIX}/share/locale) 27 | endif() 28 | 29 | if (ENABLE_QT) 30 | find_package(Qt5 5.7 REQUIRED COMPONENTS Core Gui Widgets) 31 | find_package(FcitxQt5WidgetsAddons 1.1 REQUIRED) 32 | endif () 33 | 34 | configure_file("${CMAKE_CURRENT_SOURCE_DIR}/config.h.in" 35 | "${CMAKE_CURRENT_BINARY_DIR}/config.h" 36 | IMMEDIATE @ONLY) 37 | include_directories(${CMAKE_CURRENT_BINARY_DIR}) 38 | 39 | add_subdirectory(po) 40 | add_subdirectory(src) 41 | add_subdirectory(data) 42 | add_subdirectory(gui) 43 | -------------------------------------------------------------------------------- /COPYING: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # fcitx-skk 2 | 3 | fcitx-skk is an input method engine for Fcitx, which uses libskk as its backend. 4 | 5 | ## Requirements: 6 | 7 | - libskk 8 | - Qt4 (optional), for rule and dictionary configuration UI. 9 | - fcitx 4.2.8 10 | - skk-jisyo 11 | 12 | ### For Ubuntu User 13 | 14 | Please install this packages before build this Program. 15 | 16 | - libskk-dev 17 | - qtbase5-dev 18 | - libfcitx-qt5-dev 19 | - skkdic 20 | 21 | $ sudo aptitude install libskk-dev qtbase5-dev libfcitx-qt5-dev skkdic 22 | 23 | 24 | ## Build dependency: 25 | 26 | - cmake 27 | - C++ Compiler(g++) 28 | 29 | You can specify the skk dictionary path by -DSKK_DEFAULT_PATH=path_you_want 30 | 31 | By default it's /usr/share/skk/SKK-JISYO.L 32 | 33 | ## Installation 34 | 35 | git clone https://github.com/fcitx/fcitx-skk.git 36 | cd fcitx-skk 37 | cmake . 38 | sudo make install 39 | -------------------------------------------------------------------------------- /config.h.in: -------------------------------------------------------------------------------- 1 | #ifndef ___CONFIG_H___ 2 | #define ___CONFIG_H___ 3 | 4 | #define LOCALEDIR "@LOCALEDIR@" 5 | #define SKK_DEFAULT_PATH "@SKK_DEFAULT_PATH@" 6 | 7 | #endif /* __CONFIG_H__ */ 8 | -------------------------------------------------------------------------------- /data/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | install(FILES skk.png DESTINATION share/icons/hicolor/64x64/apps RENAME fcitx-skk.png) 2 | install(FILES skk.png DESTINATION share/fcitx/imicon) 3 | -------------------------------------------------------------------------------- /data/skk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcitx/fcitx-skk/5fdc6d3e84c04fc14a18b6e5199371248615348d/data/skk.png -------------------------------------------------------------------------------- /gui/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(SKK_CONFIG_SRCS 2 | main.cpp 3 | dictwidget.cpp 4 | adddictdialog.cpp 5 | dictmodel.cpp 6 | rulemodel.cpp 7 | ) 8 | fcitx_translate_add_sources( 9 | ${SKK_CONFIG_SRCS}) 10 | 11 | if(NOT ENABLE_QT) 12 | return() 13 | endif() 14 | 15 | include_directories(${LIBSKK_INCLUDE_DIRS}) 16 | include_directories( 17 | ${CMAKE_CURRENT_BINARY_DIR} 18 | ) 19 | 20 | link_directories( 21 | ${FCITX4_FCITX_CONFIG_LIBRARY_DIRS} 22 | ${LIBSKK_LIBRARY_DIRS} 23 | ) 24 | qt5_wrap_ui(SKK_CONFIG_SRCS dictwidget.ui adddictdialog.ui) 25 | add_library(fcitx-skk-config 26 | MODULE ${SKK_CONFIG_SRCS}) 27 | 28 | add_definitions(-DQT_NO_KEYWORDS -std=c++11) 29 | 30 | set_target_properties(fcitx-skk-config PROPERTIES 31 | LINK_FLAGS "-Wl,--no-undefined" 32 | AUTOMOC TRUE 33 | ) 34 | target_link_libraries(fcitx-skk-config 35 | Qt5::Core 36 | Qt5::Widgets 37 | FcitxQt5::WidgetsAddons 38 | ${FCITX4_FCITX_CONFIG_LIBRARIES} 39 | ${LIBSKK_LIBRARIES} 40 | ) 41 | 42 | install(TARGETS fcitx-skk-config DESTINATION ${FCITX4_ADDON_INSTALL_DIR}/qt) 43 | -------------------------------------------------------------------------------- /gui/adddictdialog.cpp: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2013~2013 by CSSlayer * 3 | * wengxt@gmail.com * 4 | * * 5 | * This program is free software: you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation, either version 3 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program. If not, see . * 17 | * * 18 | ***************************************************************************/ 19 | 20 | #include 21 | #include 22 | #include 23 | 24 | #include "adddictdialog.h" 25 | #include "ui_adddictdialog.h" 26 | #include "common.h" 27 | #include "config.h" 28 | 29 | #define FCITX_CONFIG_DIR "$FCITX_CONFIG_DIR" 30 | 31 | AddDictDialog::AddDictDialog(QWidget* parent): QDialog(parent) 32 | ,m_ui(new Ui::AddDictDialog) 33 | { 34 | m_ui->setupUi(this); 35 | m_ui->typeLabel->setText(_("&Type:")); 36 | m_ui->pathLabel->setText(_("&Path:")); 37 | m_ui->hostLabel->setText(_("&Host:")); 38 | m_ui->portLabel->setText(_("&Port:")); 39 | m_ui->typeComboBox->addItem(_("System")); 40 | m_ui->typeComboBox->addItem(_("User")); 41 | m_ui->typeComboBox->addItem(_("Server")); 42 | 43 | indexChanged(0); 44 | 45 | connect(m_ui->browseButton, SIGNAL(clicked(bool)), this, SLOT(browseClicked())); 46 | connect(m_ui->typeComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(indexChanged(int))); 47 | } 48 | 49 | AddDictDialog::~AddDictDialog() 50 | { 51 | delete m_ui; 52 | } 53 | 54 | QMap AddDictDialog::dictionary() 55 | { 56 | int idx = m_ui->typeComboBox->currentIndex(); 57 | idx = idx < 0 ? 0 : idx; 58 | idx = idx > 2 ? 0 : idx; 59 | 60 | QMap dict; 61 | if (idx == 2) { 62 | dict["type"] = "server"; 63 | dict["host"] = m_ui->hostLineEdit->text(); 64 | dict["port"] = QString("%1").arg(m_ui->portSpinBox->value()); 65 | } else { 66 | const char* type[] = { 67 | "readonly", 68 | "readwrite" 69 | }; 70 | 71 | 72 | dict["type"] = "file"; 73 | dict["file"] = m_ui->urlLineEdit->text(); 74 | dict["mode"] = type[idx]; 75 | } 76 | 77 | return dict; 78 | } 79 | 80 | void AddDictDialog::indexChanged(int idx) 81 | { 82 | bool isServer = idx == 2; 83 | m_ui->pathLabel->setVisible(!isServer); 84 | m_ui->urlLineEdit->setVisible(!isServer); 85 | m_ui->browseButton->setVisible(!isServer); 86 | m_ui->hostLabel->setVisible(isServer); 87 | m_ui->hostLineEdit->setVisible(isServer); 88 | m_ui->portLabel->setVisible(isServer); 89 | m_ui->portSpinBox->setVisible(isServer); 90 | } 91 | 92 | void AddDictDialog::browseClicked() 93 | { 94 | QString path = m_ui->urlLineEdit->text(); 95 | if (m_ui->typeComboBox->currentIndex() == 0) { 96 | QString dir; 97 | if (path.isEmpty()) { 98 | path = SKK_DEFAULT_PATH; 99 | } 100 | QFileInfo info(path); 101 | path = QFileDialog::getOpenFileName(this, _("Select Dictionary File"), info.path()); 102 | } else { 103 | char* fcitxBasePath = NULL; 104 | FcitxXDGGetFileUserWithPrefix("", "", NULL, &fcitxBasePath); 105 | QString basePath = QDir::cleanPath(QString::fromLocal8Bit(fcitxBasePath)); 106 | free(fcitxBasePath); 107 | if (path.isEmpty()) { 108 | path = basePath; 109 | } else if (path.startsWith(FCITX_CONFIG_DIR "/")) { 110 | QDir dir(basePath); 111 | path = dir.filePath(path.mid(strlen(FCITX_CONFIG_DIR) + 1)); 112 | } 113 | path = QFileDialog::getOpenFileName(this, _("Select Dictionary File"), path); 114 | if (path.startsWith(basePath + "/" )) { 115 | path = FCITX_CONFIG_DIR + path.mid(basePath.length(), -1); 116 | } 117 | } 118 | 119 | if (!path.isEmpty()) { 120 | m_ui->urlLineEdit->setText(path); 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /gui/adddictdialog.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2013~2013 by CSSlayer * 3 | * wengxt@gmail.com * 4 | * * 5 | * This program is free software: you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation, either version 3 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program. If not, see . * 17 | * * 18 | ***************************************************************************/ 19 | 20 | #ifndef ADDDICTDIALOG_H 21 | #define ADDDICTDIALOG_H 22 | 23 | #include 24 | #include 25 | 26 | namespace Ui { 27 | class AddDictDialog; 28 | } 29 | 30 | class AddDictDialog : public QDialog 31 | { 32 | Q_OBJECT 33 | public: 34 | explicit AddDictDialog(QWidget* parent = 0); 35 | virtual ~AddDictDialog(); 36 | QMap dictionary(); 37 | 38 | private: 39 | Ui::AddDictDialog* m_ui; 40 | public Q_SLOTS: 41 | void browseClicked(); 42 | void indexChanged(int); 43 | }; 44 | 45 | #endif // ADDDICTDIALOG_H 46 | -------------------------------------------------------------------------------- /gui/adddictdialog.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | AddDictDialog 4 | 5 | 6 | 7 | 0 8 | 0 9 | 356 10 | 184 11 | 12 | 13 | 14 | Dialog 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | typeComboBox 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 0 34 | 0 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | urlLineEdit 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | hostLineEdit 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | portSpinBox 85 | 86 | 87 | 88 | 89 | 90 | 91 | 1 92 | 93 | 94 | 65535 95 | 96 | 97 | 1178 98 | 99 | 100 | 101 | 102 | 103 | 104 | localhost 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | Qt::Horizontal 114 | 115 | 116 | QDialogButtonBox::Cancel|QDialogButtonBox::Ok 117 | 118 | 119 | 120 | 121 | 122 | 123 | typeComboBox 124 | urlLineEdit 125 | browseButton 126 | hostLineEdit 127 | portSpinBox 128 | buttonBox 129 | 130 | 131 | 132 | 133 | buttonBox 134 | accepted() 135 | AddDictDialog 136 | accept() 137 | 138 | 139 | 252 140 | 179 141 | 142 | 143 | 157 144 | 274 145 | 146 | 147 | 148 | 149 | buttonBox 150 | rejected() 151 | AddDictDialog 152 | reject() 153 | 154 | 155 | 320 156 | 179 157 | 158 | 159 | 286 160 | 274 161 | 162 | 163 | 164 | 165 | 166 | -------------------------------------------------------------------------------- /gui/common.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2013~2013 by CSSlayer * 3 | * wengxt@gmail.com * 4 | * * 5 | * This program is free software: you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation, either version 3 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program. If not, see . * 17 | * * 18 | ***************************************************************************/ 19 | 20 | #ifndef _COMMON_H_ 21 | #define _COMMON_H_ 22 | 23 | #include 24 | 25 | #define _(x) QString::fromUtf8(dgettext("fcitx-skk", x)) 26 | 27 | #define N_(X) (X) 28 | extern const char* modeName[]; 29 | 30 | #endif // _COMMON_H_ 31 | -------------------------------------------------------------------------------- /gui/dictmodel.cpp: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2013~2013 by CSSlayer * 3 | * wengxt@gmail.com * 4 | * * 5 | * This program is free software: you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation, either version 3 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program. If not, see . * 17 | * * 18 | ***************************************************************************/ 19 | 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | 27 | #include "dictmodel.h" 28 | 29 | DictModel::DictModel(QObject* parent) : QAbstractListModel(parent) 30 | { 31 | m_requiredKeys << "file" << "type" << "mode"; 32 | } 33 | 34 | DictModel::~DictModel() 35 | { 36 | 37 | } 38 | 39 | void DictModel::defaults() 40 | { 41 | char* path = fcitx_utils_get_fcitx_path_with_filename("pkgdatadir", "skk/dictionary_list"); 42 | QFile f(path); 43 | if (f.open(QIODevice::ReadOnly)) { 44 | load(f); 45 | } 46 | } 47 | 48 | void DictModel::load() 49 | { 50 | FILE* fp = FcitxXDGGetFileWithPrefix("skk", "dictionary_list", "r", NULL); 51 | if (!fp) { 52 | return; 53 | } 54 | QFile f; 55 | if (!f.open(fp, QIODevice::ReadOnly)) { 56 | fclose(fp); 57 | return; 58 | } 59 | 60 | load(f); 61 | f.close(); 62 | fclose(fp); 63 | } 64 | 65 | void DictModel::load(QFile& file) 66 | { 67 | beginResetModel(); 68 | m_dicts.clear(); 69 | 70 | QByteArray bytes; 71 | while (!(bytes = file.readLine()).isEmpty()) { 72 | QString line = QString::fromUtf8(bytes).trimmed(); 73 | QStringList items = line.split(","); 74 | if (items.size() < m_requiredKeys.size()) { 75 | continue; 76 | } 77 | 78 | bool failed = false; 79 | QMap dict; 80 | Q_FOREACH(const QString& item, items) { 81 | if (!item.contains('=')) { 82 | failed = true; 83 | break; 84 | } 85 | QString key = item.section('=', 0, 0); 86 | QString value = item.section('=', 1, -1); 87 | 88 | if (!m_requiredKeys.contains(key)) { 89 | continue; 90 | } 91 | 92 | dict[key] = value; 93 | } 94 | 95 | if (!failed && m_requiredKeys.size() == dict.size()) { 96 | m_dicts << dict; 97 | } 98 | } 99 | endResetModel(); 100 | } 101 | 102 | bool DictModel::save() 103 | { 104 | char* name = NULL; 105 | FcitxXDGMakeDirUser("skk"); 106 | FcitxXDGGetFileUserWithPrefix("skk", "dictionary_list", NULL, &name); 107 | QString fileName = QString::fromLocal8Bit(name); 108 | QTemporaryFile tempFile(fileName); 109 | free(name); 110 | if (!tempFile.open()) { 111 | return false; 112 | } 113 | 114 | typedef QMap DictType; 115 | 116 | Q_FOREACH(const DictType& dict, m_dicts) { 117 | boolean first = true; 118 | Q_FOREACH(const QString& key, dict.keys()) { 119 | if (first) { 120 | first = false; 121 | } else { 122 | tempFile.write(","); 123 | } 124 | tempFile.write(key.toUtf8()); 125 | tempFile.write("="); 126 | tempFile.write(dict[key].toUtf8()); 127 | } 128 | tempFile.write("\n"); 129 | } 130 | 131 | tempFile.setAutoRemove(false); 132 | QFile::remove(fileName); 133 | if (!tempFile.rename(fileName)) { 134 | tempFile.remove(); 135 | return false; 136 | } 137 | 138 | return true; 139 | } 140 | 141 | int DictModel::rowCount(const QModelIndex& parent) const 142 | { 143 | return m_dicts.size(); 144 | } 145 | 146 | bool DictModel::removeRows(int row, int count, const QModelIndex& parent) 147 | { 148 | if (parent.isValid()) { 149 | return false; 150 | } 151 | 152 | if (count == 0 153 | || row >= m_dicts.size() 154 | || row + count > m_dicts.size()) { 155 | return false; 156 | } 157 | 158 | beginRemoveRows(parent, row, row + count - 1); 159 | m_dicts.erase(m_dicts.begin() + row, m_dicts.begin() + row + count); 160 | endRemoveRows(); 161 | 162 | return true; 163 | } 164 | 165 | 166 | QVariant DictModel::data(const QModelIndex& index, int role) const 167 | { 168 | if (!index.isValid()) { 169 | return QVariant(); 170 | } 171 | 172 | if (index.row() >= m_dicts.size() || index.column() != 0) { 173 | return QVariant(); 174 | } 175 | 176 | switch(role) { 177 | case Qt::DisplayRole: 178 | if (m_dicts[index.row()]["type"] == "file") { 179 | return m_dicts[index.row()]["file"]; 180 | } else { 181 | return QString("%1:%2").arg(m_dicts[index.row()]["host"], m_dicts[index.row()]["port"]); 182 | } 183 | } 184 | return QVariant(); 185 | } 186 | 187 | bool DictModel::moveUp(const QModelIndex& currentIndex) 188 | { 189 | if (currentIndex.row() > 0 190 | && currentIndex.row() < m_dicts.size()) { 191 | beginResetModel(); 192 | m_dicts.swap(currentIndex.row() - 1, currentIndex.row()); 193 | endResetModel(); 194 | return true; 195 | } 196 | return false; 197 | } 198 | 199 | bool DictModel::moveDown(const QModelIndex& currentIndex) 200 | { 201 | if (currentIndex.row() >= 0 202 | && currentIndex.row() + 1 < m_dicts.size()) { 203 | beginResetModel(); 204 | m_dicts.swap(currentIndex.row() + 1, currentIndex.row()); 205 | endResetModel(); 206 | return true; 207 | } 208 | 209 | return false; 210 | } 211 | 212 | void DictModel::add(const QMap< QString, QString >& dict) 213 | { 214 | beginInsertRows(QModelIndex(), m_dicts.size(), m_dicts.size()); 215 | m_dicts << dict; 216 | endInsertRows(); 217 | } 218 | -------------------------------------------------------------------------------- /gui/dictmodel.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2013~2013 by CSSlayer * 3 | * wengxt@gmail.com * 4 | * * 5 | * This program is free software: you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation, either version 3 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program. If not, see . * 17 | * * 18 | ***************************************************************************/ 19 | 20 | #ifndef DICTMODEL_H 21 | #define DICTMODEL_H 22 | #include 23 | #include 24 | #include 25 | 26 | class DictModel : public QAbstractListModel 27 | { 28 | Q_OBJECT 29 | public: 30 | explicit DictModel(QObject* parent = 0); 31 | virtual ~DictModel(); 32 | virtual int rowCount(const QModelIndex& parent = QModelIndex()) const; 33 | virtual QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const; 34 | virtual bool removeRows(int row, int count, const QModelIndex& parent = QModelIndex()); 35 | 36 | void load(); 37 | void load(QFile& file); 38 | void defaults(); 39 | bool save(); 40 | void add(const QMap& dict); 41 | bool moveDown(const QModelIndex& currentIndex); 42 | bool moveUp(const QModelIndex& currentIndex); 43 | private: 44 | QSet m_requiredKeys; 45 | QList< QMap< QString, QString> > m_dicts; 46 | }; 47 | 48 | #endif // DICTMODEL_H 49 | -------------------------------------------------------------------------------- /gui/dictwidget.cpp: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2013~2013 by CSSlayer * 3 | * wengxt@gmail.com * 4 | * * 5 | * This program is free software: you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation, either version 3 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program. If not, see . * 17 | * * 18 | ***************************************************************************/ 19 | 20 | #include "common.h" 21 | #include "dictwidget.h" 22 | #include "adddictdialog.h" 23 | #include "dictmodel.h" 24 | #include "rulemodel.h" 25 | #include "ui_dictwidget.h" 26 | #include 27 | 28 | SkkDictWidget::SkkDictWidget(QWidget* parent): FcitxQtConfigUIWidget(parent) 29 | ,m_ui(new Ui::SkkDictWidget) 30 | { 31 | m_ui->setupUi(this); 32 | m_dictModel = new DictModel(this); 33 | m_ruleModel = new RuleModel(this); 34 | m_ui->ruleLabel->setText(_("&Rule:")); 35 | 36 | m_ui->dictionaryView->setModel(m_dictModel); 37 | m_ui->ruleComboBox->setModel(m_ruleModel); 38 | 39 | connect(m_ui->addDictButton, SIGNAL(clicked(bool)), this, SLOT(addDictClicked())); 40 | connect(m_ui->defaultDictButton, SIGNAL(clicked(bool)), this, SLOT(defaultDictClicked())); 41 | connect(m_ui->removeDictButton, SIGNAL(clicked(bool)), this, SLOT(removeDictClicked())); 42 | connect(m_ui->moveUpDictButton, SIGNAL(clicked(bool)), this, SLOT(moveUpDictClicked())); 43 | connect(m_ui->moveDownDictButton, SIGNAL(clicked(bool)), this, SLOT(moveDownClicked())); 44 | connect(m_ui->ruleComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(ruleChanged(int))); 45 | 46 | load(); 47 | } 48 | 49 | SkkDictWidget::~SkkDictWidget() 50 | { 51 | delete m_ui; 52 | } 53 | 54 | QString SkkDictWidget::addon() 55 | { 56 | return "fcitx-skk"; 57 | } 58 | 59 | QString SkkDictWidget::title() 60 | { 61 | return _("Dictionary Manager"); 62 | } 63 | 64 | QString SkkDictWidget::icon() 65 | { 66 | return "fcitx-skk"; 67 | } 68 | 69 | void SkkDictWidget::load() 70 | { 71 | m_dictModel->load(); 72 | 73 | FILE* fp = FcitxXDGGetFileWithPrefix("skk", "rule", "r", NULL); 74 | 75 | QString sline; 76 | do { 77 | if (!fp) { 78 | break; 79 | } 80 | 81 | QFile f; 82 | QByteArray line; 83 | if (f.open(fp, QIODevice::ReadOnly)) {; 84 | line = f.readLine(); 85 | f.close(); 86 | } 87 | fclose(fp); 88 | 89 | sline = QString::fromUtf8(line).trimmed(); 90 | 91 | if (sline.isEmpty()) { 92 | sline = "default"; 93 | } 94 | } while(0); 95 | m_ruleModel->load(); 96 | int idx = m_ruleModel->findRule(sline); 97 | idx = idx < 0 ? 0 : idx; 98 | m_ui->ruleComboBox->setCurrentIndex(idx); 99 | Q_EMIT changed(false); 100 | } 101 | 102 | void SkkDictWidget::save() 103 | { 104 | m_dictModel->save(); 105 | QString name = m_ruleModel->data(m_ruleModel->index(m_ui->ruleComboBox->currentIndex(), 0), Qt::UserRole).toString(); 106 | FILE* fp = FcitxXDGGetFileUserWithPrefix("skk", "rule", "w", NULL); 107 | if (!fp) { 108 | return; 109 | } 110 | 111 | QFile f; 112 | if (f.open(fp, QIODevice::WriteOnly)) { 113 | f.write(name.toUtf8()); 114 | f.close(); 115 | } 116 | 117 | fclose(fp); 118 | Q_EMIT changed(false); 119 | } 120 | 121 | void SkkDictWidget::addDictClicked() 122 | { 123 | AddDictDialog dialog; 124 | int result = dialog.exec(); 125 | if (result == QDialog::Accepted) { 126 | m_dictModel->add(dialog.dictionary()); 127 | Q_EMIT changed(true); 128 | } 129 | } 130 | 131 | void SkkDictWidget::defaultDictClicked() 132 | { 133 | m_dictModel->defaults(); 134 | Q_EMIT changed(true); 135 | } 136 | 137 | void SkkDictWidget::removeDictClicked() 138 | { 139 | if (m_ui->dictionaryView->currentIndex().isValid()) { 140 | m_dictModel->removeRow(m_ui->dictionaryView->currentIndex().row()); 141 | Q_EMIT changed(true); 142 | } 143 | } 144 | 145 | void SkkDictWidget::moveUpDictClicked() 146 | { 147 | int row = m_ui->dictionaryView->currentIndex().row(); 148 | if (m_dictModel->moveUp(m_ui->dictionaryView->currentIndex())) { 149 | m_ui->dictionaryView->selectionModel()->setCurrentIndex( 150 | m_dictModel->index(row - 1), QItemSelectionModel::ClearAndSelect); 151 | Q_EMIT changed(true); 152 | } 153 | } 154 | 155 | void SkkDictWidget::moveDownClicked() 156 | { 157 | int row = m_ui->dictionaryView->currentIndex().row(); 158 | if (m_dictModel->moveDown(m_ui->dictionaryView->currentIndex())) { 159 | m_ui->dictionaryView->selectionModel()->setCurrentIndex( 160 | m_dictModel->index(row + 1), QItemSelectionModel::ClearAndSelect); 161 | Q_EMIT changed(true); 162 | } 163 | } 164 | 165 | void SkkDictWidget::ruleChanged(int ) 166 | { 167 | Q_EMIT changed(true); 168 | } 169 | -------------------------------------------------------------------------------- /gui/dictwidget.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2013~2013 by CSSlayer * 3 | * wengxt@gmail.com * 4 | * * 5 | * This program is free software: you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation, either version 3 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program. If not, see . * 17 | * * 18 | ***************************************************************************/ 19 | 20 | #ifndef FCITX_SKK_GUI_DICTWIDGET_H 21 | #define FCITX_SKK_GUI_DICTWIDGET_H 22 | 23 | #include 24 | 25 | class RuleModel; 26 | class DictModel; 27 | namespace Ui { 28 | class SkkDictWidget; 29 | } 30 | 31 | class SkkDictWidget : public FcitxQtConfigUIWidget 32 | { 33 | Q_OBJECT 34 | public: 35 | explicit SkkDictWidget(QWidget* parent = 0); 36 | virtual ~SkkDictWidget(); 37 | 38 | virtual void load(); 39 | virtual void save(); 40 | virtual QString title(); 41 | virtual QString addon(); 42 | virtual QString icon(); 43 | 44 | private Q_SLOTS: 45 | void addDictClicked(); 46 | void defaultDictClicked(); 47 | void removeDictClicked(); 48 | void moveUpDictClicked(); 49 | void moveDownClicked(); 50 | void ruleChanged(int); 51 | private: 52 | Ui::SkkDictWidget* m_ui; 53 | DictModel* m_dictModel; 54 | RuleModel* m_ruleModel; 55 | }; 56 | 57 | 58 | #endif // FCITX_SKK_GUI_DICTWIDGET_H 59 | -------------------------------------------------------------------------------- /gui/dictwidget.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | SkkDictWidget 4 | 5 | 6 | 7 | 0 8 | 0 9 | 355 10 | 247 11 | 12 | 13 | 14 | Form 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | ruleComboBox 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 0 34 | 0 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | Qt::Vertical 112 | 113 | 114 | 115 | 20 116 | 40 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | -------------------------------------------------------------------------------- /gui/main.cpp: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2013~2013 by CSSlayer * 3 | * wengxt@gmail.com * 4 | * * 5 | * This program is free software: you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation, either version 3 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program. If not, see . * 17 | * * 18 | ***************************************************************************/ 19 | 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include "main.h" 27 | #include "dictwidget.h" 28 | 29 | SkkConfigPlugin::SkkConfigPlugin(QObject* parent): FcitxQtConfigUIPlugin(parent) 30 | { 31 | #if !GLIB_CHECK_VERSION(2, 36, 0) 32 | g_type_init(); 33 | #endif 34 | skk_init(); 35 | } 36 | 37 | FcitxQtConfigUIWidget* SkkConfigPlugin::create(const QString& key) 38 | { 39 | if (key == "skk/dictionary_list") { 40 | return new SkkDictWidget; 41 | } 42 | return NULL; 43 | } 44 | 45 | QStringList SkkConfigPlugin::files() 46 | { 47 | QStringList fileList; 48 | fileList << "skk/dictionary_list"; 49 | return fileList; 50 | } 51 | 52 | QString SkkConfigPlugin::name() 53 | { 54 | return "skk-config"; 55 | } 56 | 57 | QString SkkConfigPlugin::domain() 58 | { 59 | return "fcitx-skk"; 60 | } 61 | -------------------------------------------------------------------------------- /gui/main.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2013~2013 by CSSlayer * 3 | * wengxt@gmail.com * 4 | * * 5 | * This program is free software: you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation, either version 3 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program. If not, see . * 17 | * * 18 | ***************************************************************************/ 19 | 20 | #ifndef FCITX_SKK_GUI_MAIN_H_ 21 | #define FCITX_SKK_GUI_MAIN_H_ 22 | 23 | #include 24 | 25 | class SkkConfigPlugin : public FcitxQtConfigUIPlugin 26 | { 27 | Q_OBJECT 28 | public: 29 | Q_PLUGIN_METADATA(IID FcitxQtConfigUIFactoryInterface_iid FILE "skk-config.json") 30 | explicit SkkConfigPlugin(QObject* parent = 0); 31 | virtual QString name(); 32 | virtual QStringList files(); 33 | virtual QString domain(); 34 | virtual FcitxQtConfigUIWidget* create(const QString& key); 35 | }; 36 | 37 | #endif // FCITX_TOOLS_GUI_MAIN_H_ 38 | -------------------------------------------------------------------------------- /gui/rulemodel.cpp: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2013~2013 by CSSlayer * 3 | * wengxt@gmail.com * 4 | * * 5 | * This program is free software: you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation, either version 3 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program. If not, see . * 17 | * * 18 | ***************************************************************************/ 19 | 20 | #include "rulemodel.h" 21 | #include 22 | 23 | RuleModel::RuleModel(QObject* parent): QAbstractListModel(parent) 24 | { 25 | } 26 | 27 | RuleModel::~RuleModel() 28 | { 29 | } 30 | 31 | void RuleModel::load() 32 | { 33 | beginResetModel(); 34 | int length; 35 | SkkRuleMetadata* rules = skk_rule_list(&length); 36 | for (int i = 0; i < length; i++) { 37 | m_rules << Rule(QString::fromUtf8(rules[i].name), QString::fromUtf8(rules[i].label)); 38 | skk_rule_metadata_destroy(&rules[i]); 39 | } 40 | g_free(rules); 41 | endResetModel(); 42 | } 43 | 44 | int RuleModel::rowCount(const QModelIndex& parent) const 45 | { 46 | return m_rules.size(); 47 | } 48 | 49 | QVariant RuleModel::data(const QModelIndex& index, int role) const 50 | { 51 | if (!index.isValid()) { 52 | return QVariant(); 53 | } 54 | 55 | if (index.row() >= m_rules.size() || index.column() != 0) { 56 | return QVariant(); 57 | } 58 | 59 | switch(role) { 60 | case Qt::DisplayRole: 61 | return m_rules[index.row()].label(); 62 | case Qt::UserRole: 63 | return m_rules[index.row()].name(); 64 | } 65 | return QVariant(); 66 | } 67 | 68 | int RuleModel::findRule(const QString& name) 69 | { 70 | int i = 0; 71 | Q_FOREACH (const Rule& rule, m_rules) { 72 | if (rule.name() == name) { 73 | return i; 74 | } 75 | i ++; 76 | } 77 | return -1; 78 | } 79 | -------------------------------------------------------------------------------- /gui/rulemodel.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2013~2013 by CSSlayer * 3 | * wengxt@gmail.com * 4 | * * 5 | * This program is free software: you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation, either version 3 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program. If not, see . * 17 | * * 18 | ***************************************************************************/ 19 | 20 | #ifndef RULEMODEL_H 21 | #define RULEMODEL_H 22 | #include 23 | 24 | #include 25 | 26 | class Rule { 27 | public: 28 | Rule(const QString& name, const QString& label) : 29 | m_name(name), 30 | m_label(label) 31 | { 32 | } 33 | 34 | const QString& name() const { 35 | return m_name; 36 | } 37 | 38 | const QString& label() const { 39 | return m_label; 40 | } 41 | 42 | private: 43 | QString m_name; 44 | QString m_label; 45 | }; 46 | 47 | class RuleModel : public QAbstractListModel 48 | { 49 | Q_OBJECT 50 | public: 51 | explicit RuleModel(QObject* parent = 0); 52 | 53 | virtual ~RuleModel(); 54 | 55 | virtual int rowCount(const QModelIndex& parent = QModelIndex()) const; 56 | virtual QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const; 57 | void load(); 58 | int findRule(const QString& name); 59 | 60 | private: 61 | QList m_rules; 62 | }; 63 | 64 | #endif // RULEMODEL_H 65 | -------------------------------------------------------------------------------- /gui/skk-config.json: -------------------------------------------------------------------------------- 1 | { 2 | } 3 | -------------------------------------------------------------------------------- /po/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | file(GLOB PO_FILES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" *.po) 2 | 3 | foreach(po_file ${PO_FILES}) 4 | string(REPLACE ".po" "" po_lang "${po_file}") 5 | fcitx_translate_add_po_file("${po_lang}" "${po_file}") 6 | endforeach() 7 | fcitx_translate_set_pot_target(pot fcitx-skk fcitx-skk.pot) 8 | -------------------------------------------------------------------------------- /po/ca.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER 3 | # This file is distributed under the same license as the PACKAGE package. 4 | # 5 | # Translators: 6 | # Robert Antoni Buj Gelonch , 2017 7 | # Walter Garcia-Fontes , 2017 8 | msgid "" 9 | msgstr "" 10 | "Project-Id-Version: fcitx\n" 11 | "Report-Msgid-Bugs-To: fcitx-dev@googlegroups.com\n" 12 | "POT-Creation-Date: 2020-01-13 00:01-0800\n" 13 | "PO-Revision-Date: 2017-12-20 05:20+0000\n" 14 | "Last-Translator: Robert Antoni Buj Gelonch \n" 15 | "Language-Team: Catalan (http://www.transifex.com/fcitx/fcitx/language/ca/)\n" 16 | "Language: ca\n" 17 | "MIME-Version: 1.0\n" 18 | "Content-Type: text/plain; charset=UTF-8\n" 19 | "Content-Transfer-Encoding: 8bit\n" 20 | "Plural-Forms: nplurals=2; plural=(n != 1);\n" 21 | 22 | #: gui/adddictdialog.cpp:37 23 | msgid "&Host:" 24 | msgstr "&Amfitrió:" 25 | 26 | #: gui/adddictdialog.cpp:36 27 | msgid "&Path:" 28 | msgstr "&Camí:" 29 | 30 | #: gui/adddictdialog.cpp:38 31 | msgid "&Port:" 32 | msgstr "&Port:" 33 | 34 | #: gui/dictwidget.cpp:34 35 | msgid "&Rule:" 36 | msgstr "&Regla" 37 | 38 | #: gui/adddictdialog.cpp:35 39 | msgid "&Type:" 40 | msgstr "&Tipus:" 41 | 42 | #: src/fcitx-skk.desc:60 43 | msgid "ABC (a,b,c,...)" 44 | msgstr "ABC (a,b,c,...)" 45 | 46 | #: src/fcitx-skk.desc:36 47 | msgid "Candidate List Layout" 48 | msgstr "Disposició de la llista de candidates" 49 | 50 | #: gui/dictwidget.cpp:61 51 | msgid "Dictionary Manager" 52 | msgstr "Gestor de diccionari" 53 | 54 | #: src/fcitx-skk.conf.in:9 55 | msgid "Dictionary and Rule" 56 | msgstr "Diccionari i regla" 57 | 58 | #: src/fcitx-skk.desc:59 59 | msgid "Digit (0,1,2,...)" 60 | msgstr "Dígit (0,1,2,...)" 61 | 62 | #: src/fcitx-skk.desc:19 63 | msgid "Direct input" 64 | msgstr "Entrada directa" 65 | 66 | #: src/fcitx-skk.desc:1 src/fcitx-skk.desc:11 src/fcitx-skk.desc:22 67 | #: src/fcitx-skk.desc:29 src/fcitx-skk.desc:34 src/fcitx-skk.desc:43 68 | #: src/fcitx-skk.desc:50 src/fcitx-skk.desc:55 69 | msgid "General" 70 | msgstr "General" 71 | 72 | #: src/fcitx-skk.desc:38 73 | msgid "Global" 74 | msgstr "Global" 75 | 76 | #: src/skk.c:97 src/fcitx-skk.desc:18 77 | msgid "Half width Katakana" 78 | msgstr "Katakana amplada mitjana" 79 | 80 | #: src/skk.c:95 src/fcitx-skk.desc:16 81 | msgid "Hiragana" 82 | msgstr "Hiragana" 83 | 84 | #: src/fcitx-skk.desc:40 85 | msgid "Horizontal" 86 | msgstr "Horitzontal" 87 | 88 | #: src/fcitx-skk.desc:13 89 | msgid "Initial Input Mode" 90 | msgstr "Mètode d'entrada inicial" 91 | 92 | #: src/skk.c:466 93 | msgid "Input Mode" 94 | msgstr "Mode d'entrada" 95 | 96 | #: src/fcitx-skk.desc:6 97 | msgid "Japanese" 98 | msgstr "Japonès" 99 | 100 | #: src/skk.c:96 src/fcitx-skk.desc:17 101 | msgid "Katakana" 102 | msgstr "Katakana" 103 | 104 | #: src/fcitx-skk.desc:57 105 | msgid "Keys to Select from Candidate Window" 106 | msgstr "Tecles per seleccionar de la finestra de candidates" 107 | 108 | #: src/skk.c:98 src/fcitx-skk.desc:7 109 | msgid "Latin" 110 | msgstr "Llatí" 111 | 112 | #: src/fcitx-skk.desc:45 113 | msgid "Number candidate of Triggers To Show Candidate Window" 114 | msgstr "" 115 | "Nombre de candidates d'activadors per mostrar la finestra de candidates" 116 | 117 | #: src/fcitx-skk.desc:24 118 | msgid "Page size" 119 | msgstr "Mida de pàgina" 120 | 121 | #: src/fcitx-skk.desc:3 122 | msgid "Punctuation Style" 123 | msgstr "Estil de puntuació" 124 | 125 | #: src/fcitx-skk.desc:61 126 | msgid "Qwerty Center Row (a,s,d,...)" 127 | msgstr "Fila central qwerty (a,s,d,...)" 128 | 129 | #: src/fcitx-skk.desc:31 130 | msgid "Return-key does not insert new line on commit" 131 | msgstr "La tecla Retorn no insereix una línia nova amb l'enviament" 132 | 133 | #: gui/adddictdialog.cpp:101 gui/adddictdialog.cpp:113 134 | msgid "Select Dictionary File" 135 | msgstr "Selecciona el fitxer de diccionari" 136 | 137 | #: gui/adddictdialog.cpp:41 138 | msgid "Server" 139 | msgstr "Servidor" 140 | 141 | #: src/fcitx-skk.desc:52 142 | msgid "Show Annotation" 143 | msgstr "Mostra l'anotació" 144 | 145 | #: src/skk.c:440 src/fcitx-skk.conf.in:3 src/skk.conf.in:3 146 | msgid "Skk" 147 | msgstr "Skk" 148 | 149 | #: src/fcitx-skk.conf.in:4 150 | msgid "Skk Input Method For Fcitx" 151 | msgstr "Mètode d'entrada skk per a fcitx" 152 | 153 | #: gui/adddictdialog.cpp:39 154 | msgid "System" 155 | msgstr "Sistema" 156 | 157 | #: gui/adddictdialog.cpp:40 158 | msgid "User" 159 | msgstr "Usuari" 160 | 161 | #: src/fcitx-skk.desc:39 162 | msgid "Vertical" 163 | msgstr "Vertical" 164 | 165 | #: src/skk.c:99 src/fcitx-skk.desc:8 src/fcitx-skk.desc:20 166 | msgid "Wide latin" 167 | msgstr "Llatí ample" 168 | 169 | #: src/fcitx-skk.desc:9 170 | msgid "Wide latin Japanese" 171 | msgstr "Japonès llatí ample" 172 | -------------------------------------------------------------------------------- /po/da.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER 3 | # This file is distributed under the same license as the PACKAGE package. 4 | # 5 | # Translators: 6 | # scootergrisen, 2017,2019 7 | msgid "" 8 | msgstr "" 9 | "Project-Id-Version: fcitx\n" 10 | "Report-Msgid-Bugs-To: fcitx-dev@googlegroups.com\n" 11 | "POT-Creation-Date: 2014-12-08 12:40+0900\n" 12 | "PO-Revision-Date: 2019-11-19 15:23+0000\n" 13 | "Last-Translator: scootergrisen\n" 14 | "Language-Team: Danish (http://www.transifex.com/fcitx/fcitx/language/da/)\n" 15 | "MIME-Version: 1.0\n" 16 | "Content-Type: text/plain; charset=UTF-8\n" 17 | "Content-Transfer-Encoding: 8bit\n" 18 | "Language: da\n" 19 | "Plural-Forms: nplurals=2; plural=(n != 1);\n" 20 | 21 | #: gui/adddictdialog.cpp:35 22 | msgid "&Type:" 23 | msgstr "&Type:" 24 | 25 | #: gui/adddictdialog.cpp:36 26 | msgid "&Path:" 27 | msgstr "&Sti:" 28 | 29 | #: gui/adddictdialog.cpp:37 30 | msgid "&Host:" 31 | msgstr "&Vært:" 32 | 33 | #: gui/adddictdialog.cpp:38 34 | msgid "&Port:" 35 | msgstr "&Port:" 36 | 37 | #: gui/adddictdialog.cpp:39 38 | msgid "System" 39 | msgstr "System" 40 | 41 | #: gui/adddictdialog.cpp:40 42 | msgid "User" 43 | msgstr "Bruger" 44 | 45 | #: gui/adddictdialog.cpp:41 46 | msgid "Server" 47 | msgstr "Server" 48 | 49 | #: gui/adddictdialog.cpp:101 gui/adddictdialog.cpp:113 50 | msgid "Select Dictionary File" 51 | msgstr "Vælg ordbogsfil" 52 | 53 | #: gui/dictwidget.cpp:34 54 | msgid "&Rule:" 55 | msgstr "&Regel:" 56 | 57 | #: gui/dictwidget.cpp:61 58 | msgid "Dictionary Manager" 59 | msgstr "Ordbogshåndtering" 60 | 61 | #: src/skk.c:95 src/fcitx-skk.desc:16 62 | msgid "Hiragana" 63 | msgstr "Hiragana" 64 | 65 | #: src/skk.c:96 src/fcitx-skk.desc:17 66 | msgid "Katakana" 67 | msgstr "Katakana" 68 | 69 | #: src/skk.c:97 src/fcitx-skk.desc:18 70 | msgid "Half width Katakana" 71 | msgstr "Katakana med halv bredde" 72 | 73 | #: src/skk.c:98 src/fcitx-skk.desc:7 74 | msgid "Latin" 75 | msgstr "Latinsk" 76 | 77 | #: src/skk.c:99 src/fcitx-skk.desc:8 src/fcitx-skk.desc:20 78 | msgid "Wide latin" 79 | msgstr "Bred latinsk" 80 | 81 | #: src/skk.c:440 src/fcitx-skk.conf.in:3 src/skk.conf.in:3 82 | msgid "Skk" 83 | msgstr "Skk" 84 | 85 | #: src/skk.c:466 86 | msgid "Input Mode" 87 | msgstr "Inputtilstand" 88 | 89 | #: src/fcitx-skk.conf.in:4 90 | msgid "Skk Input Method For Fcitx" 91 | msgstr "Skk-inputmetode til Fcitx" 92 | 93 | #: src/fcitx-skk.conf.in:9 94 | msgid "Dictionary and Rule" 95 | msgstr "Ordbog og regel" 96 | 97 | #: src/fcitx-skk.desc:1 src/fcitx-skk.desc:11 src/fcitx-skk.desc:22 98 | #: src/fcitx-skk.desc:29 src/fcitx-skk.desc:34 src/fcitx-skk.desc:43 99 | #: src/fcitx-skk.desc:50 src/fcitx-skk.desc:55 100 | msgid "General" 101 | msgstr "Generelt" 102 | 103 | #: src/fcitx-skk.desc:3 104 | msgid "Punctuation Style" 105 | msgstr "Tegnsætningsstil" 106 | 107 | #: src/fcitx-skk.desc:6 108 | msgid "Japanese" 109 | msgstr "Japansk" 110 | 111 | #: src/fcitx-skk.desc:9 112 | msgid "Wide latin Japanese" 113 | msgstr "Bred latinsk japansk" 114 | 115 | #: src/fcitx-skk.desc:13 116 | msgid "Initial Input Mode" 117 | msgstr "Indledende inputtilstand" 118 | 119 | #: src/fcitx-skk.desc:19 120 | msgid "Direct input" 121 | msgstr "Direkte input" 122 | 123 | #: src/fcitx-skk.desc:24 124 | msgid "Page size" 125 | msgstr "Sidestørrelse" 126 | 127 | #: src/fcitx-skk.desc:31 128 | msgid "Return-key does not insert new line on commit" 129 | msgstr "Returtast indsætter ikke linjeskift ved udfør" 130 | 131 | #: src/fcitx-skk.desc:36 132 | msgid "Candidate List Layout" 133 | msgstr "Layout for kandidatliste" 134 | 135 | #: src/fcitx-skk.desc:38 136 | msgid "Global" 137 | msgstr "Global" 138 | 139 | #: src/fcitx-skk.desc:39 140 | msgid "Vertical" 141 | msgstr "Lodret" 142 | 143 | #: src/fcitx-skk.desc:40 144 | msgid "Horizontal" 145 | msgstr "Vandret" 146 | 147 | #: src/fcitx-skk.desc:45 148 | msgid "Number candidate of Triggers To Show Candidate Window" 149 | msgstr "Antal kandidater af udløsere før kandidatvindue vises" 150 | 151 | #: src/fcitx-skk.desc:52 152 | msgid "Show Annotation" 153 | msgstr "Vis annotering" 154 | 155 | #: src/fcitx-skk.desc:57 156 | msgid "Keys to Select from Candidate Window" 157 | msgstr "Taster til at vælge fra kandidatvindue" 158 | 159 | #: src/fcitx-skk.desc:59 160 | msgid "Digit (0,1,2,...)" 161 | msgstr "Tal (0,1,2 ...)" 162 | 163 | #: src/fcitx-skk.desc:60 164 | msgid "ABC (a,b,c,...)" 165 | msgstr "ABC (a,b,c ...)" 166 | 167 | #: src/fcitx-skk.desc:61 168 | msgid "Qwerty Center Row (a,s,d,...)" 169 | msgstr "Qwerty-midterrække (a,s,d ...)" 170 | -------------------------------------------------------------------------------- /po/de.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER 3 | # This file is distributed under the same license as the PACKAGE package. 4 | # 5 | # Translators: 6 | # mar well , 2013 7 | # mar well , 2014,2017 8 | msgid "" 9 | msgstr "" 10 | "Project-Id-Version: fcitx\n" 11 | "Report-Msgid-Bugs-To: fcitx-dev@googlegroups.com\n" 12 | "POT-Creation-Date: 2017-07-28 06:03-0700\n" 13 | "PO-Revision-Date: 2017-07-28 12:44+0000\n" 14 | "Last-Translator: mar well \n" 15 | "Language-Team: German (http://www.transifex.com/fcitx/fcitx/language/de/)\n" 16 | "Language: de\n" 17 | "MIME-Version: 1.0\n" 18 | "Content-Type: text/plain; charset=UTF-8\n" 19 | "Content-Transfer-Encoding: 8bit\n" 20 | "Plural-Forms: nplurals=2; plural=(n != 1);\n" 21 | 22 | #: gui/adddictdialog.cpp:37 23 | msgid "&Host:" 24 | msgstr "&Host:" 25 | 26 | #: gui/adddictdialog.cpp:36 27 | msgid "&Path:" 28 | msgstr "&Pfad:" 29 | 30 | #: gui/adddictdialog.cpp:38 31 | msgid "&Port:" 32 | msgstr "&Port:" 33 | 34 | #: gui/dictwidget.cpp:34 35 | msgid "&Rule:" 36 | msgstr "&Regel:" 37 | 38 | #: gui/adddictdialog.cpp:35 39 | msgid "&Type:" 40 | msgstr "&Typ:" 41 | 42 | #: src/fcitx-skk.desc:60 43 | msgid "ABC (a,b,c,...)" 44 | msgstr "ABC (a,b,c,...)" 45 | 46 | #: src/fcitx-skk.desc:36 47 | msgid "Candidate List Layout" 48 | msgstr "Layout der Kandidatenliste" 49 | 50 | #: gui/dictwidget.cpp:61 51 | msgid "Dictionary Manager" 52 | msgstr "Wörterbuchverwaltung" 53 | 54 | #: src/fcitx-skk.conf.in:9 55 | msgid "Dictionary and Rule" 56 | msgstr "Wörterbücher und Regeln" 57 | 58 | #: src/fcitx-skk.desc:59 59 | msgid "Digit (0,1,2,...)" 60 | msgstr "Ziffer (0,1,2,...)" 61 | 62 | #: src/fcitx-skk.desc:19 63 | msgid "Direct input" 64 | msgstr "Direkte Eingabe" 65 | 66 | #: src/fcitx-skk.desc:1 src/fcitx-skk.desc:11 src/fcitx-skk.desc:22 67 | #: src/fcitx-skk.desc:29 src/fcitx-skk.desc:34 src/fcitx-skk.desc:43 68 | #: src/fcitx-skk.desc:50 src/fcitx-skk.desc:55 69 | msgid "General" 70 | msgstr "Allgemein" 71 | 72 | #: src/fcitx-skk.desc:38 73 | msgid "Global" 74 | msgstr "Global" 75 | 76 | #: src/skk.c:97 src/fcitx-skk.desc:18 77 | msgid "Half width Katakana" 78 | msgstr "Halbbreite Katakana" 79 | 80 | #: src/skk.c:95 src/fcitx-skk.desc:16 81 | msgid "Hiragana" 82 | msgstr "Hiragana" 83 | 84 | #: src/fcitx-skk.desc:40 85 | msgid "Horizontal" 86 | msgstr "Waagerecht" 87 | 88 | #: src/fcitx-skk.desc:13 89 | msgid "Initial Input Mode" 90 | msgstr "Eingabemodus beim Start" 91 | 92 | #: src/skk.c:466 93 | msgid "Input Mode" 94 | msgstr "Eingabemodus" 95 | 96 | #: src/fcitx-skk.desc:6 97 | msgid "Japanese" 98 | msgstr "Japanisch" 99 | 100 | #: src/skk.c:96 src/fcitx-skk.desc:17 101 | msgid "Katakana" 102 | msgstr "Katakana" 103 | 104 | #: src/fcitx-skk.desc:57 105 | msgid "Keys to Select from Candidate Window" 106 | msgstr "Auswahltaste für die Kandidaten" 107 | 108 | #: src/skk.c:98 src/fcitx-skk.desc:7 109 | msgid "Latin" 110 | msgstr "Latin" 111 | 112 | #: src/fcitx-skk.desc:45 113 | msgid "Number candidate of Triggers To Show Candidate Window" 114 | msgstr "Anzahl der Kanditaten, bei der das Kandidatenfenster angezeigt wird" 115 | 116 | #: src/fcitx-skk.desc:24 117 | msgid "Page size" 118 | msgstr "Seitengröße" 119 | 120 | #: src/fcitx-skk.desc:3 121 | msgid "Punctuation Style" 122 | msgstr "Stil der Interpunktion" 123 | 124 | #: src/fcitx-skk.desc:61 125 | msgid "Qwerty Center Row (a,s,d,...)" 126 | msgstr "Mittlere Reihe der QWERTY Tastatur (a,s,d,...)" 127 | 128 | #: src/fcitx-skk.desc:31 129 | msgid "Return-key does not insert new line on commit" 130 | msgstr "Return-Taste erzeugt keinen Zeilenwechsel" 131 | 132 | #: gui/adddictdialog.cpp:101 gui/adddictdialog.cpp:113 133 | msgid "Select Dictionary File" 134 | msgstr "Wörterbuchdatei auswählen" 135 | 136 | #: gui/adddictdialog.cpp:41 137 | msgid "Server" 138 | msgstr "Server" 139 | 140 | #: src/fcitx-skk.desc:52 141 | msgid "Show Annotation" 142 | msgstr "Anmerkungen zeigen" 143 | 144 | #: src/skk.c:440 src/fcitx-skk.conf.in:3 src/skk.conf.in:3 145 | msgid "Skk" 146 | msgstr "Skk" 147 | 148 | #: src/fcitx-skk.conf.in:4 149 | msgid "Skk Input Method For Fcitx" 150 | msgstr "Skk Eingabemethode für Fcitx" 151 | 152 | #: gui/adddictdialog.cpp:39 153 | msgid "System" 154 | msgstr "System" 155 | 156 | #: gui/adddictdialog.cpp:40 157 | msgid "User" 158 | msgstr "Benutzer" 159 | 160 | #: src/fcitx-skk.desc:39 161 | msgid "Vertical" 162 | msgstr "Senkrecht" 163 | 164 | #: src/skk.c:99 src/fcitx-skk.desc:8 src/fcitx-skk.desc:20 165 | msgid "Wide latin" 166 | msgstr "Vollbreites Latin" 167 | 168 | #: src/fcitx-skk.desc:9 169 | msgid "Wide latin Japanese" 170 | msgstr "Wide latin Japanisch" 171 | -------------------------------------------------------------------------------- /po/fcitx-skk.pot: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER 3 | # This file is distributed under the same license as the PACKAGE package. 4 | # FIRST AUTHOR , YEAR. 5 | # 6 | #, fuzzy 7 | msgid "" 8 | msgstr "" 9 | "Project-Id-Version: PACKAGE VERSION\n" 10 | "Report-Msgid-Bugs-To: fcitx-dev@googlegroups.com\n" 11 | "POT-Creation-Date: 2014-12-08 12:40+0900\n" 12 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 13 | "Last-Translator: FULL NAME \n" 14 | "Language-Team: LANGUAGE \n" 15 | "Language: LANG\n" 16 | "MIME-Version: 1.0\n" 17 | "Content-Type: text/plain; charset=utf-8\n" 18 | "Content-Transfer-Encoding: 8bit\n" 19 | 20 | #: gui/adddictdialog.cpp:35 21 | msgid "&Type:" 22 | msgstr "" 23 | 24 | #: gui/adddictdialog.cpp:36 25 | msgid "&Path:" 26 | msgstr "" 27 | 28 | #: gui/adddictdialog.cpp:37 29 | msgid "&Host:" 30 | msgstr "" 31 | 32 | #: gui/adddictdialog.cpp:38 33 | msgid "&Port:" 34 | msgstr "" 35 | 36 | #: gui/adddictdialog.cpp:39 37 | msgid "System" 38 | msgstr "" 39 | 40 | #: gui/adddictdialog.cpp:40 41 | msgid "User" 42 | msgstr "" 43 | 44 | #: gui/adddictdialog.cpp:41 45 | msgid "Server" 46 | msgstr "" 47 | 48 | #: gui/adddictdialog.cpp:101 gui/adddictdialog.cpp:113 49 | msgid "Select Dictionary File" 50 | msgstr "" 51 | 52 | #: gui/dictwidget.cpp:34 53 | msgid "&Rule:" 54 | msgstr "" 55 | 56 | #: gui/dictwidget.cpp:61 57 | msgid "Dictionary Manager" 58 | msgstr "" 59 | 60 | #: src/skk.c:95 src/fcitx-skk.desc:16 61 | msgid "Hiragana" 62 | msgstr "" 63 | 64 | #: src/skk.c:96 src/fcitx-skk.desc:17 65 | msgid "Katakana" 66 | msgstr "" 67 | 68 | #: src/skk.c:97 src/fcitx-skk.desc:18 69 | msgid "Half width Katakana" 70 | msgstr "" 71 | 72 | #: src/skk.c:98 src/fcitx-skk.desc:7 73 | msgid "Latin" 74 | msgstr "" 75 | 76 | #: src/skk.c:99 src/fcitx-skk.desc:8 src/fcitx-skk.desc:20 77 | msgid "Wide latin" 78 | msgstr "" 79 | 80 | #: src/skk.c:440 src/fcitx-skk.conf.in:3 src/skk.conf.in:3 81 | msgid "Skk" 82 | msgstr "" 83 | 84 | #: src/skk.c:466 85 | msgid "Input Mode" 86 | msgstr "" 87 | 88 | #: src/fcitx-skk.conf.in:4 89 | msgid "Skk Input Method For Fcitx" 90 | msgstr "" 91 | 92 | #: src/fcitx-skk.conf.in:9 93 | msgid "Dictionary and Rule" 94 | msgstr "" 95 | 96 | #: src/fcitx-skk.desc:1 src/fcitx-skk.desc:11 src/fcitx-skk.desc:22 97 | #: src/fcitx-skk.desc:29 src/fcitx-skk.desc:34 src/fcitx-skk.desc:43 98 | #: src/fcitx-skk.desc:50 src/fcitx-skk.desc:55 99 | msgid "General" 100 | msgstr "" 101 | 102 | #: src/fcitx-skk.desc:3 103 | msgid "Punctuation Style" 104 | msgstr "" 105 | 106 | #: src/fcitx-skk.desc:6 107 | msgid "Japanese" 108 | msgstr "" 109 | 110 | #: src/fcitx-skk.desc:9 111 | msgid "Wide latin Japanese" 112 | msgstr "" 113 | 114 | #: src/fcitx-skk.desc:13 115 | msgid "Initial Input Mode" 116 | msgstr "" 117 | 118 | #: src/fcitx-skk.desc:19 119 | msgid "Direct input" 120 | msgstr "" 121 | 122 | #: src/fcitx-skk.desc:24 123 | msgid "Page size" 124 | msgstr "" 125 | 126 | #: src/fcitx-skk.desc:31 127 | msgid "Return-key does not insert new line on commit" 128 | msgstr "" 129 | 130 | #: src/fcitx-skk.desc:36 131 | msgid "Candidate List Layout" 132 | msgstr "" 133 | 134 | #: src/fcitx-skk.desc:38 135 | msgid "Global" 136 | msgstr "" 137 | 138 | #: src/fcitx-skk.desc:39 139 | msgid "Vertical" 140 | msgstr "" 141 | 142 | #: src/fcitx-skk.desc:40 143 | msgid "Horizontal" 144 | msgstr "" 145 | 146 | #: src/fcitx-skk.desc:45 147 | msgid "Number candidate of Triggers To Show Candidate Window" 148 | msgstr "" 149 | 150 | #: src/fcitx-skk.desc:52 151 | msgid "Show Annotation" 152 | msgstr "" 153 | 154 | #: src/fcitx-skk.desc:57 155 | msgid "Keys to Select from Candidate Window" 156 | msgstr "" 157 | 158 | #: src/fcitx-skk.desc:59 159 | msgid "Digit (0,1,2,...)" 160 | msgstr "" 161 | 162 | #: src/fcitx-skk.desc:60 163 | msgid "ABC (a,b,c,...)" 164 | msgstr "" 165 | 166 | #: src/fcitx-skk.desc:61 167 | msgid "Qwerty Center Row (a,s,d,...)" 168 | msgstr "" 169 | -------------------------------------------------------------------------------- /po/ja.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER 3 | # This file is distributed under the same license as the PACKAGE package. 4 | # 5 | # Translators: 6 | # あわしろいくや , 2014 7 | # emasaka , 2014 8 | # emasaka , 2014 9 | # Takuro Onoue , 2022 10 | # shirou - しろう , 2013 11 | msgid "" 12 | msgstr "" 13 | "Project-Id-Version: fcitx\n" 14 | "Report-Msgid-Bugs-To: fcitx-dev@googlegroups.com\n" 15 | "POT-Creation-Date: 2022-03-22 20:27+0000\n" 16 | "PO-Revision-Date: 2013-03-25 22:20+0000\n" 17 | "Last-Translator: Takuro Onoue , 2022\n" 18 | "Language-Team: Japanese (http://www.transifex.com/fcitx/fcitx/language/ja/)\n" 19 | "Language: ja\n" 20 | "MIME-Version: 1.0\n" 21 | "Content-Type: text/plain; charset=UTF-8\n" 22 | "Content-Transfer-Encoding: 8bit\n" 23 | "Plural-Forms: nplurals=1; plural=0;\n" 24 | 25 | #: gui/adddictdialog.cpp:37 26 | msgid "&Host:" 27 | msgstr "ホスト(&H):" 28 | 29 | #: gui/adddictdialog.cpp:36 30 | msgid "&Path:" 31 | msgstr "パス(&P):" 32 | 33 | #: gui/adddictdialog.cpp:38 34 | msgid "&Port:" 35 | msgstr "ポート(&P):" 36 | 37 | #: gui/dictwidget.cpp:34 38 | msgid "&Rule:" 39 | msgstr "タイピング方式(&R):" 40 | 41 | #: gui/adddictdialog.cpp:35 42 | msgid "&Type:" 43 | msgstr "形式(&T):" 44 | 45 | #: src/fcitx-skk.desc:60 46 | msgid "ABC (a,b,c,...)" 47 | msgstr "ABC (a,b,c,...)" 48 | 49 | #: src/fcitx-skk.desc:36 50 | msgid "Candidate List Layout" 51 | msgstr "候補リストのレイアウト" 52 | 53 | #: gui/dictwidget.cpp:61 54 | msgid "Dictionary Manager" 55 | msgstr "辞書マネージャー" 56 | 57 | #: src/fcitx-skk.conf.in:9 58 | msgid "Dictionary and Rule" 59 | msgstr "辞書とタイピング方式" 60 | 61 | #: src/fcitx-skk.desc:59 62 | msgid "Digit (0,1,2,...)" 63 | msgstr "数字キー (0,1,2,...)" 64 | 65 | #: src/fcitx-skk.desc:19 66 | msgid "Direct input" 67 | msgstr "直接入力" 68 | 69 | #: src/fcitx-skk.desc:1 src/fcitx-skk.desc:11 src/fcitx-skk.desc:22 70 | #: src/fcitx-skk.desc:29 src/fcitx-skk.desc:34 src/fcitx-skk.desc:43 71 | #: src/fcitx-skk.desc:50 src/fcitx-skk.desc:55 72 | msgid "General" 73 | msgstr "全般" 74 | 75 | #: src/fcitx-skk.desc:38 76 | msgid "Global" 77 | msgstr "全体" 78 | 79 | #: src/skk.c:97 src/fcitx-skk.desc:18 80 | msgid "Half width Katakana" 81 | msgstr "半角カタカナ" 82 | 83 | #: src/skk.c:95 src/fcitx-skk.desc:16 84 | msgid "Hiragana" 85 | msgstr "ひらがな" 86 | 87 | #: src/fcitx-skk.desc:40 88 | msgid "Horizontal" 89 | msgstr "水平" 90 | 91 | #: src/fcitx-skk.desc:13 92 | msgid "Initial Input Mode" 93 | msgstr "初期入力モード" 94 | 95 | #: src/skk.c:466 96 | msgid "Input Mode" 97 | msgstr "入力モード" 98 | 99 | #: src/fcitx-skk.desc:6 100 | msgid "Japanese" 101 | msgstr "日本語" 102 | 103 | #: src/skk.c:96 src/fcitx-skk.desc:17 104 | msgid "Katakana" 105 | msgstr "カタカナ" 106 | 107 | #: src/fcitx-skk.desc:57 108 | msgid "Keys to Select from Candidate Window" 109 | msgstr "候補ウィンドウからの選択キー" 110 | 111 | #: src/skk.c:98 src/fcitx-skk.desc:7 112 | msgid "Latin" 113 | msgstr "英数" 114 | 115 | #: src/fcitx-skk.desc:45 116 | msgid "Number candidate of Triggers To Show Candidate Window" 117 | msgstr "候補ウィンドウを表示するまでの候補数" 118 | 119 | #: src/fcitx-skk.desc:24 120 | msgid "Page size" 121 | msgstr "ページサイズ" 122 | 123 | #: src/fcitx-skk.desc:3 124 | msgid "Punctuation Style" 125 | msgstr "句読点スタイル" 126 | 127 | #: src/fcitx-skk.desc:61 128 | msgid "Qwerty Center Row (a,s,d,...)" 129 | msgstr "Qwertyキーボード中央行 (a,s,d,...)" 130 | 131 | #: src/fcitx-skk.desc:31 132 | msgid "Return-key does not insert new line on commit" 133 | msgstr "確定時にリターンキーを押しても改行を挿入しない" 134 | 135 | #: gui/adddictdialog.cpp:101 gui/adddictdialog.cpp:113 136 | msgid "Select Dictionary File" 137 | msgstr "辞書ファイルを選択" 138 | 139 | #: gui/adddictdialog.cpp:41 140 | msgid "Server" 141 | msgstr "SKK サーバー" 142 | 143 | #: src/fcitx-skk.desc:52 144 | msgid "Show Annotation" 145 | msgstr "注釈を表示" 146 | 147 | #: src/skk.c:440 src/fcitx-skk.conf.in:3 src/skk.conf.in:3 148 | msgid "Skk" 149 | msgstr "SKK" 150 | 151 | #: src/fcitx-skk.conf.in:4 152 | msgid "Skk Input Method For Fcitx" 153 | msgstr "Fcitx用のSKK入力メソッド" 154 | 155 | #: gui/adddictdialog.cpp:39 156 | msgid "System" 157 | msgstr "システム" 158 | 159 | #: gui/adddictdialog.cpp:40 160 | msgid "User" 161 | msgstr "ユーザー" 162 | 163 | #: src/fcitx-skk.desc:39 164 | msgid "Vertical" 165 | msgstr "垂直" 166 | 167 | #: src/skk.c:99 src/fcitx-skk.desc:8 src/fcitx-skk.desc:20 168 | msgid "Wide latin" 169 | msgstr "全角英数" 170 | 171 | #: src/fcitx-skk.desc:9 172 | msgid "Wide latin Japanese" 173 | msgstr "全角英字と日本語" 174 | -------------------------------------------------------------------------------- /po/ko.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER 3 | # This file is distributed under the same license as the PACKAGE package. 4 | # 5 | # Translators: 6 | # Bon Keun Seo , 2017 7 | # Junghee Lee , 2020 8 | # Junghee Lee , 2022 9 | # Junghee Lee , 2020 10 | msgid "" 11 | msgstr "" 12 | "Project-Id-Version: fcitx\n" 13 | "Report-Msgid-Bugs-To: fcitx-dev@googlegroups.com\n" 14 | "POT-Creation-Date: 2022-04-10 20:28+0000\n" 15 | "PO-Revision-Date: 2013-03-25 22:20+0000\n" 16 | "Last-Translator: Junghee Lee , 2022\n" 17 | "Language-Team: Korean (http://www.transifex.com/fcitx/fcitx/language/ko/)\n" 18 | "Language: ko\n" 19 | "MIME-Version: 1.0\n" 20 | "Content-Type: text/plain; charset=UTF-8\n" 21 | "Content-Transfer-Encoding: 8bit\n" 22 | "Plural-Forms: nplurals=1; plural=0;\n" 23 | 24 | #: gui/adddictdialog.cpp:37 25 | msgid "&Host:" 26 | msgstr "호스트(&H)" 27 | 28 | #: gui/adddictdialog.cpp:36 29 | msgid "&Path:" 30 | msgstr "경로(&P)" 31 | 32 | #: gui/adddictdialog.cpp:38 33 | msgid "&Port:" 34 | msgstr "포트(&P):" 35 | 36 | #: gui/dictwidget.cpp:34 37 | msgid "&Rule:" 38 | msgstr "규칙(&R)" 39 | 40 | #: gui/adddictdialog.cpp:35 41 | msgid "&Type:" 42 | msgstr "유형(&T):" 43 | 44 | #: src/fcitx-skk.desc:60 45 | msgid "ABC (a,b,c,...)" 46 | msgstr "알파벳 (a, b, c, ...)" 47 | 48 | #: src/fcitx-skk.desc:36 49 | msgid "Candidate List Layout" 50 | msgstr "후보 목록 자판" 51 | 52 | #: gui/dictwidget.cpp:61 53 | msgid "Dictionary Manager" 54 | msgstr "사전 관리자" 55 | 56 | #: src/fcitx-skk.conf.in:9 57 | msgid "Dictionary and Rule" 58 | msgstr "사전 및 규칙" 59 | 60 | #: src/fcitx-skk.desc:59 61 | msgid "Digit (0,1,2,...)" 62 | msgstr "숫자 (0, 1, 2, ...)" 63 | 64 | #: src/fcitx-skk.desc:19 65 | msgid "Direct input" 66 | msgstr "직접 입력" 67 | 68 | #: src/fcitx-skk.desc:1 src/fcitx-skk.desc:11 src/fcitx-skk.desc:22 69 | #: src/fcitx-skk.desc:29 src/fcitx-skk.desc:34 src/fcitx-skk.desc:43 70 | #: src/fcitx-skk.desc:50 src/fcitx-skk.desc:55 71 | msgid "General" 72 | msgstr "일반" 73 | 74 | #: src/fcitx-skk.desc:38 75 | msgid "Global" 76 | msgstr "전역" 77 | 78 | #: src/skk.c:97 src/fcitx-skk.desc:18 79 | msgid "Half width Katakana" 80 | msgstr "반각 가타카나" 81 | 82 | #: src/skk.c:95 src/fcitx-skk.desc:16 83 | msgid "Hiragana" 84 | msgstr "히라가나" 85 | 86 | #: src/fcitx-skk.desc:40 87 | msgid "Horizontal" 88 | msgstr "가로" 89 | 90 | #: src/fcitx-skk.desc:13 91 | msgid "Initial Input Mode" 92 | msgstr "초기 입력 모드" 93 | 94 | #: src/skk.c:466 95 | msgid "Input Mode" 96 | msgstr "입력 모드" 97 | 98 | #: src/fcitx-skk.desc:6 99 | msgid "Japanese" 100 | msgstr "일본어" 101 | 102 | #: src/skk.c:96 src/fcitx-skk.desc:17 103 | msgid "Katakana" 104 | msgstr "가타카나" 105 | 106 | #: src/fcitx-skk.desc:57 107 | msgid "Keys to Select from Candidate Window" 108 | msgstr "후보 창에서 선택하는 키" 109 | 110 | #: src/skk.c:98 src/fcitx-skk.desc:7 111 | msgid "Latin" 112 | msgstr "로마자" 113 | 114 | #: src/fcitx-skk.desc:45 115 | msgid "Number candidate of Triggers To Show Candidate Window" 116 | msgstr "후보 단어 창의 표시를 트리거한 키 입력 수" 117 | 118 | #: src/fcitx-skk.desc:24 119 | msgid "Page size" 120 | msgstr "페이지 크기" 121 | 122 | #: src/fcitx-skk.desc:3 123 | msgid "Punctuation Style" 124 | msgstr "문장부호 스타일" 125 | 126 | #: src/fcitx-skk.desc:61 127 | msgid "Qwerty Center Row (a,s,d,...)" 128 | msgstr "키보드 중간열 (a, s, d, ...)" 129 | 130 | #: src/fcitx-skk.desc:31 131 | msgid "Return-key does not insert new line on commit" 132 | msgstr "입력 완료 시 엔터키가 새 줄을 추가하지 않음" 133 | 134 | #: gui/adddictdialog.cpp:101 gui/adddictdialog.cpp:113 135 | msgid "Select Dictionary File" 136 | msgstr "사전 파일 선택" 137 | 138 | #: gui/adddictdialog.cpp:41 139 | msgid "Server" 140 | msgstr "서버" 141 | 142 | #: src/fcitx-skk.desc:52 143 | msgid "Show Annotation" 144 | msgstr "주석 표시" 145 | 146 | #: src/skk.c:440 src/fcitx-skk.conf.in:3 src/skk.conf.in:3 147 | msgid "Skk" 148 | msgstr "Skk" 149 | 150 | #: src/fcitx-skk.conf.in:4 151 | msgid "Skk Input Method For Fcitx" 152 | msgstr "Fcitx용 Skk 입력기" 153 | 154 | #: gui/adddictdialog.cpp:39 155 | msgid "System" 156 | msgstr "시스템" 157 | 158 | #: gui/adddictdialog.cpp:40 159 | msgid "User" 160 | msgstr "사용자" 161 | 162 | #: src/fcitx-skk.desc:39 163 | msgid "Vertical" 164 | msgstr "세로" 165 | 166 | #: src/skk.c:99 src/fcitx-skk.desc:8 src/fcitx-skk.desc:20 167 | msgid "Wide latin" 168 | msgstr "전각 로마자" 169 | 170 | #: src/fcitx-skk.desc:9 171 | msgid "Wide latin Japanese" 172 | msgstr "전각 로마자 일본어" 173 | -------------------------------------------------------------------------------- /po/ru.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER 3 | # This file is distributed under the same license as the PACKAGE package. 4 | # 5 | # Translators: 6 | # Dmitry , 2022,2024 7 | # TotalCaesar659 , 2016 8 | # TotalCaesar659 , 2016 9 | msgid "" 10 | msgstr "" 11 | "Project-Id-Version: fcitx\n" 12 | "Report-Msgid-Bugs-To: fcitx-dev@googlegroups.com\n" 13 | "POT-Creation-Date: 2024-04-16 20:30+0000\n" 14 | "PO-Revision-Date: 2013-03-25 22:20+0000\n" 15 | "Last-Translator: Dmitry , 2022,2024\n" 16 | "Language-Team: Russian (http://app.transifex.com/fcitx/fcitx/language/ru/)\n" 17 | "Language: ru\n" 18 | "MIME-Version: 1.0\n" 19 | "Content-Type: text/plain; charset=UTF-8\n" 20 | "Content-Transfer-Encoding: 8bit\n" 21 | "Plural-Forms: nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && " 22 | "n%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || " 23 | "(n%100>=11 && n%100<=14)? 2 : 3);\n" 24 | 25 | #: gui/adddictdialog.cpp:37 26 | msgid "&Host:" 27 | msgstr "&Хост:" 28 | 29 | #: gui/adddictdialog.cpp:36 30 | msgid "&Path:" 31 | msgstr "&Путь:" 32 | 33 | #: gui/adddictdialog.cpp:38 34 | msgid "&Port:" 35 | msgstr "&Порт:" 36 | 37 | #: gui/dictwidget.cpp:34 38 | msgid "&Rule:" 39 | msgstr "&Правило:" 40 | 41 | #: gui/adddictdialog.cpp:35 42 | msgid "&Type:" 43 | msgstr "&Тип:" 44 | 45 | #: src/fcitx-skk.desc:60 46 | msgid "ABC (a,b,c,...)" 47 | msgstr "ABC (a,b,c,...)" 48 | 49 | #: src/fcitx-skk.desc:36 50 | msgid "Candidate List Layout" 51 | msgstr "Расположение списка слов-кандидатов" 52 | 53 | #: gui/dictwidget.cpp:61 54 | msgid "Dictionary Manager" 55 | msgstr "Менеджер словарей" 56 | 57 | #: src/fcitx-skk.conf.in:9 58 | msgid "Dictionary and Rule" 59 | msgstr "Словарь и правило" 60 | 61 | #: src/fcitx-skk.desc:59 62 | msgid "Digit (0,1,2,...)" 63 | msgstr "Цифра (0,1,2,...)" 64 | 65 | #: src/fcitx-skk.desc:19 66 | msgid "Direct input" 67 | msgstr "Прямой ввод" 68 | 69 | #: src/fcitx-skk.desc:1 src/fcitx-skk.desc:11 src/fcitx-skk.desc:22 70 | #: src/fcitx-skk.desc:29 src/fcitx-skk.desc:34 src/fcitx-skk.desc:43 71 | #: src/fcitx-skk.desc:50 src/fcitx-skk.desc:55 72 | msgid "General" 73 | msgstr "Основной" 74 | 75 | #: src/fcitx-skk.desc:38 76 | msgid "Global" 77 | msgstr "Общий" 78 | 79 | #: src/skk.c:97 src/fcitx-skk.desc:18 80 | msgid "Half width Katakana" 81 | msgstr "Полуширинная Катакана" 82 | 83 | #: src/skk.c:95 src/fcitx-skk.desc:16 84 | msgid "Hiragana" 85 | msgstr "Хирагана" 86 | 87 | #: src/fcitx-skk.desc:40 88 | msgid "Horizontal" 89 | msgstr "Горизонтально" 90 | 91 | #: src/fcitx-skk.desc:13 92 | msgid "Initial Input Mode" 93 | msgstr "Начальный режим ввода" 94 | 95 | #: src/skk.c:466 96 | msgid "Input Mode" 97 | msgstr "Режим ввода" 98 | 99 | #: src/fcitx-skk.desc:6 100 | msgid "Japanese" 101 | msgstr "Японский" 102 | 103 | #: src/skk.c:96 src/fcitx-skk.desc:17 104 | msgid "Katakana" 105 | msgstr "Катакана" 106 | 107 | #: src/fcitx-skk.desc:57 108 | msgid "Keys to Select from Candidate Window" 109 | msgstr "Клавиши для выбора из окна кандидатов" 110 | 111 | #: src/skk.c:98 src/fcitx-skk.desc:7 112 | msgid "Latin" 113 | msgstr "Латынь" 114 | 115 | #: src/fcitx-skk.desc:45 116 | msgid "Number candidate of Triggers To Show Candidate Window" 117 | msgstr "Число переключений кандидатов для отображения окна кандидатов" 118 | 119 | #: src/fcitx-skk.desc:24 120 | msgid "Page size" 121 | msgstr "Размер страницы" 122 | 123 | #: src/fcitx-skk.desc:3 124 | msgid "Punctuation Style" 125 | msgstr "Стиль пунктуации" 126 | 127 | #: src/fcitx-skk.desc:61 128 | msgid "Qwerty Center Row (a,s,d,...)" 129 | msgstr "Центральный ряд Qwerty (a,s,d,...)" 130 | 131 | #: src/fcitx-skk.desc:31 132 | msgid "Return-key does not insert new line on commit" 133 | msgstr "Клавиша Enter не вставляет новую строку при вводе" 134 | 135 | #: gui/adddictdialog.cpp:101 gui/adddictdialog.cpp:113 136 | msgid "Select Dictionary File" 137 | msgstr "Выбрать файл словаря" 138 | 139 | #: gui/adddictdialog.cpp:41 140 | msgid "Server" 141 | msgstr "Сервер" 142 | 143 | #: src/fcitx-skk.desc:52 144 | msgid "Show Annotation" 145 | msgstr "Показывать аннотацию" 146 | 147 | #: src/skk.c:440 src/fcitx-skk.conf.in:3 src/skk.conf.in:3 148 | msgid "Skk" 149 | msgstr "Skk" 150 | 151 | #: src/fcitx-skk.conf.in:4 152 | msgid "Skk Input Method For Fcitx" 153 | msgstr "Метод ввода Skk для Fcitx" 154 | 155 | #: gui/adddictdialog.cpp:39 156 | msgid "System" 157 | msgstr "Система" 158 | 159 | #: gui/adddictdialog.cpp:40 160 | msgid "User" 161 | msgstr "Пользователь" 162 | 163 | #: src/fcitx-skk.desc:39 164 | msgid "Vertical" 165 | msgstr "Вертикально" 166 | 167 | #: src/skk.c:99 src/fcitx-skk.desc:8 src/fcitx-skk.desc:20 168 | msgid "Wide latin" 169 | msgstr "Wide latin" 170 | 171 | #: src/fcitx-skk.desc:9 172 | msgid "Wide latin Japanese" 173 | msgstr "Японский Wide latin" 174 | -------------------------------------------------------------------------------- /po/tr.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER 3 | # This file is distributed under the same license as the PACKAGE package. 4 | # 5 | # Translators: 6 | # Gökhan Kalayci , 2017 7 | msgid "" 8 | msgstr "" 9 | "Project-Id-Version: fcitx\n" 10 | "Report-Msgid-Bugs-To: fcitx-dev@googlegroups.com\n" 11 | "POT-Creation-Date: 2014-12-08 12:40+0900\n" 12 | "PO-Revision-Date: 2017-04-20 20:34+0000\n" 13 | "Last-Translator: Gökhan Kalayci \n" 14 | "Language-Team: Turkish (http://www.transifex.com/fcitx/fcitx/language/tr/)\n" 15 | "MIME-Version: 1.0\n" 16 | "Content-Type: text/plain; charset=UTF-8\n" 17 | "Content-Transfer-Encoding: 8bit\n" 18 | "Language: tr\n" 19 | "Plural-Forms: nplurals=2; plural=(n > 1);\n" 20 | 21 | #: gui/adddictdialog.cpp:35 22 | msgid "&Type:" 23 | msgstr "&Tip:" 24 | 25 | #: gui/adddictdialog.cpp:36 26 | msgid "&Path:" 27 | msgstr "&Yol:" 28 | 29 | #: gui/adddictdialog.cpp:37 30 | msgid "&Host:" 31 | msgstr "&Host:" 32 | 33 | #: gui/adddictdialog.cpp:38 34 | msgid "&Port:" 35 | msgstr "&Port:" 36 | 37 | #: gui/adddictdialog.cpp:39 38 | msgid "System" 39 | msgstr "Sistem" 40 | 41 | #: gui/adddictdialog.cpp:40 42 | msgid "User" 43 | msgstr "Kullanıcı" 44 | 45 | #: gui/adddictdialog.cpp:41 46 | msgid "Server" 47 | msgstr "Sunucu" 48 | 49 | #: gui/adddictdialog.cpp:101 gui/adddictdialog.cpp:113 50 | msgid "Select Dictionary File" 51 | msgstr "Sözlük Dosyasını Seçin" 52 | 53 | #: gui/dictwidget.cpp:34 54 | msgid "&Rule:" 55 | msgstr "&Kural:" 56 | 57 | #: gui/dictwidget.cpp:61 58 | msgid "Dictionary Manager" 59 | msgstr "Sözlük Yönetimi" 60 | 61 | #: src/skk.c:95 src/fcitx-skk.desc:16 62 | msgid "Hiragana" 63 | msgstr "Hiragana" 64 | 65 | #: src/skk.c:96 src/fcitx-skk.desc:17 66 | msgid "Katakana" 67 | msgstr "Katakana" 68 | 69 | #: src/skk.c:97 src/fcitx-skk.desc:18 70 | msgid "Half width Katakana" 71 | msgstr "Yarı geniş Katakana" 72 | 73 | #: src/skk.c:98 src/fcitx-skk.desc:7 74 | msgid "Latin" 75 | msgstr "Latin" 76 | 77 | #: src/skk.c:99 src/fcitx-skk.desc:8 src/fcitx-skk.desc:20 78 | msgid "Wide latin" 79 | msgstr "Geniş latin" 80 | 81 | #: src/skk.c:440 src/fcitx-skk.conf.in:3 src/skk.conf.in:3 82 | msgid "Skk" 83 | msgstr "Skk" 84 | 85 | #: src/skk.c:466 86 | msgid "Input Mode" 87 | msgstr "Giriş Yöntemi" 88 | 89 | #: src/fcitx-skk.conf.in:4 90 | msgid "Skk Input Method For Fcitx" 91 | msgstr "Fcitx için Skk Giriş Yöntemi" 92 | 93 | #: src/fcitx-skk.conf.in:9 94 | msgid "Dictionary and Rule" 95 | msgstr "Sözlük ve Kural" 96 | 97 | #: src/fcitx-skk.desc:1 src/fcitx-skk.desc:11 src/fcitx-skk.desc:22 98 | #: src/fcitx-skk.desc:29 src/fcitx-skk.desc:34 src/fcitx-skk.desc:43 99 | #: src/fcitx-skk.desc:50 src/fcitx-skk.desc:55 100 | msgid "General" 101 | msgstr "Genel" 102 | 103 | #: src/fcitx-skk.desc:3 104 | msgid "Punctuation Style" 105 | msgstr "Noktalama İşareti Stili" 106 | 107 | #: src/fcitx-skk.desc:6 108 | msgid "Japanese" 109 | msgstr "Japonca" 110 | 111 | #: src/fcitx-skk.desc:9 112 | msgid "Wide latin Japanese" 113 | msgstr "Geniş latin Japonca" 114 | 115 | #: src/fcitx-skk.desc:13 116 | msgid "Initial Input Mode" 117 | msgstr "Başlangıç Giriş Modu" 118 | 119 | #: src/fcitx-skk.desc:19 120 | msgid "Direct input" 121 | msgstr "Doğrudan giriş" 122 | 123 | #: src/fcitx-skk.desc:24 124 | msgid "Page size" 125 | msgstr "Sayfa boyutu" 126 | 127 | #: src/fcitx-skk.desc:31 128 | msgid "Return-key does not insert new line on commit" 129 | msgstr "Dönüş anahtarı, tamamlandığında yeni satır eklemez" 130 | 131 | #: src/fcitx-skk.desc:36 132 | msgid "Candidate List Layout" 133 | msgstr "Aday Liste Düzeni" 134 | 135 | #: src/fcitx-skk.desc:38 136 | msgid "Global" 137 | msgstr "Küresel" 138 | 139 | #: src/fcitx-skk.desc:39 140 | msgid "Vertical" 141 | msgstr "Dikey" 142 | 143 | #: src/fcitx-skk.desc:40 144 | msgid "Horizontal" 145 | msgstr "Yatay" 146 | 147 | #: src/fcitx-skk.desc:45 148 | msgid "Number candidate of Triggers To Show Candidate Window" 149 | msgstr "Aday Penceresini Gösteren Tetikleyicilerin Aday Sayısı" 150 | 151 | #: src/fcitx-skk.desc:52 152 | msgid "Show Annotation" 153 | msgstr "Açıklamayı Göster" 154 | 155 | #: src/fcitx-skk.desc:57 156 | msgid "Keys to Select from Candidate Window" 157 | msgstr "Aday Pencereden Seçilecek Tuşlar" 158 | 159 | #: src/fcitx-skk.desc:59 160 | msgid "Digit (0,1,2,...)" 161 | msgstr "Sayısal (0,1,2,...)" 162 | 163 | #: src/fcitx-skk.desc:60 164 | msgid "ABC (a,b,c,...)" 165 | msgstr "ABC (a,b,c,...)" 166 | 167 | #: src/fcitx-skk.desc:61 168 | msgid "Qwerty Center Row (a,s,d,...)" 169 | msgstr "Qwerty Orta Dizi (a,s,d,...)" 170 | -------------------------------------------------------------------------------- /po/vi.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER 3 | # This file is distributed under the same license as the PACKAGE package. 4 | # 5 | # Translators: 6 | # Trong Dzang , 2013 7 | msgid "" 8 | msgstr "" 9 | "Project-Id-Version: fcitx\n" 10 | "Report-Msgid-Bugs-To: fcitx-dev@googlegroups.com\n" 11 | "POT-Creation-Date: 2020-01-13 00:01-0800\n" 12 | "PO-Revision-Date: 2017-09-19 16:05+0000\n" 13 | "Last-Translator: csslayer \n" 14 | "Language-Team: Vietnamese (http://www.transifex.com/fcitx/fcitx/language/" 15 | "vi/)\n" 16 | "Language: vi\n" 17 | "MIME-Version: 1.0\n" 18 | "Content-Type: text/plain; charset=UTF-8\n" 19 | "Content-Transfer-Encoding: 8bit\n" 20 | "Plural-Forms: nplurals=1; plural=0;\n" 21 | 22 | #: gui/adddictdialog.cpp:37 23 | msgid "&Host:" 24 | msgstr "" 25 | 26 | #: gui/adddictdialog.cpp:36 27 | msgid "&Path:" 28 | msgstr "" 29 | 30 | #: gui/adddictdialog.cpp:38 31 | msgid "&Port:" 32 | msgstr "" 33 | 34 | #: gui/dictwidget.cpp:34 35 | msgid "&Rule:" 36 | msgstr "" 37 | 38 | #: gui/adddictdialog.cpp:35 39 | msgid "&Type:" 40 | msgstr "" 41 | 42 | #: src/fcitx-skk.desc:60 43 | msgid "ABC (a,b,c,...)" 44 | msgstr "" 45 | 46 | #: src/fcitx-skk.desc:36 47 | msgid "Candidate List Layout" 48 | msgstr "" 49 | 50 | #: gui/dictwidget.cpp:61 51 | msgid "Dictionary Manager" 52 | msgstr "" 53 | 54 | #: src/fcitx-skk.conf.in:9 55 | msgid "Dictionary and Rule" 56 | msgstr "" 57 | 58 | #: src/fcitx-skk.desc:59 59 | msgid "Digit (0,1,2,...)" 60 | msgstr "" 61 | 62 | #: src/fcitx-skk.desc:19 63 | msgid "Direct input" 64 | msgstr "" 65 | 66 | #: src/fcitx-skk.desc:1 src/fcitx-skk.desc:11 src/fcitx-skk.desc:22 67 | #: src/fcitx-skk.desc:29 src/fcitx-skk.desc:34 src/fcitx-skk.desc:43 68 | #: src/fcitx-skk.desc:50 src/fcitx-skk.desc:55 69 | msgid "General" 70 | msgstr "" 71 | 72 | #: src/fcitx-skk.desc:38 73 | msgid "Global" 74 | msgstr "" 75 | 76 | #: src/skk.c:97 src/fcitx-skk.desc:18 77 | msgid "Half width Katakana" 78 | msgstr "" 79 | 80 | #: src/skk.c:95 src/fcitx-skk.desc:16 81 | msgid "Hiragana" 82 | msgstr "" 83 | 84 | #: src/fcitx-skk.desc:40 85 | msgid "Horizontal" 86 | msgstr "" 87 | 88 | #: src/fcitx-skk.desc:13 89 | msgid "Initial Input Mode" 90 | msgstr "" 91 | 92 | #: src/skk.c:466 93 | msgid "Input Mode" 94 | msgstr "" 95 | 96 | #: src/fcitx-skk.desc:6 97 | msgid "Japanese" 98 | msgstr "" 99 | 100 | #: src/skk.c:96 src/fcitx-skk.desc:17 101 | msgid "Katakana" 102 | msgstr "" 103 | 104 | #: src/fcitx-skk.desc:57 105 | msgid "Keys to Select from Candidate Window" 106 | msgstr "" 107 | 108 | #: src/skk.c:98 src/fcitx-skk.desc:7 109 | msgid "Latin" 110 | msgstr "" 111 | 112 | #: src/fcitx-skk.desc:45 113 | msgid "Number candidate of Triggers To Show Candidate Window" 114 | msgstr "" 115 | 116 | #: src/fcitx-skk.desc:24 117 | msgid "Page size" 118 | msgstr "" 119 | 120 | #: src/fcitx-skk.desc:3 121 | msgid "Punctuation Style" 122 | msgstr "" 123 | 124 | #: src/fcitx-skk.desc:61 125 | msgid "Qwerty Center Row (a,s,d,...)" 126 | msgstr "" 127 | 128 | #: src/fcitx-skk.desc:31 129 | msgid "Return-key does not insert new line on commit" 130 | msgstr "" 131 | 132 | #: gui/adddictdialog.cpp:101 gui/adddictdialog.cpp:113 133 | msgid "Select Dictionary File" 134 | msgstr "" 135 | 136 | #: gui/adddictdialog.cpp:41 137 | msgid "Server" 138 | msgstr "" 139 | 140 | #: src/fcitx-skk.desc:52 141 | msgid "Show Annotation" 142 | msgstr "" 143 | 144 | #: src/skk.c:440 src/fcitx-skk.conf.in:3 src/skk.conf.in:3 145 | msgid "Skk" 146 | msgstr "Skk" 147 | 148 | #: src/fcitx-skk.conf.in:4 149 | msgid "Skk Input Method For Fcitx" 150 | msgstr "Bộ nhập liệu Skk cho Fcitx" 151 | 152 | #: gui/adddictdialog.cpp:39 153 | msgid "System" 154 | msgstr "" 155 | 156 | #: gui/adddictdialog.cpp:40 157 | msgid "User" 158 | msgstr "" 159 | 160 | #: src/fcitx-skk.desc:39 161 | msgid "Vertical" 162 | msgstr "" 163 | 164 | #: src/skk.c:99 src/fcitx-skk.desc:8 src/fcitx-skk.desc:20 165 | msgid "Wide latin" 166 | msgstr "" 167 | 168 | #: src/fcitx-skk.desc:9 169 | msgid "Wide latin Japanese" 170 | msgstr "" 171 | -------------------------------------------------------------------------------- /po/zh_CN.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER 3 | # This file is distributed under the same license as the PACKAGE package. 4 | # 5 | # Translators: 6 | # Christopher Meng , 2013 7 | # csslayer , 2013 8 | # wwj402 , 2015 9 | msgid "" 10 | msgstr "" 11 | "Project-Id-Version: fcitx\n" 12 | "Report-Msgid-Bugs-To: fcitx-dev@googlegroups.com\n" 13 | "POT-Creation-Date: 2020-01-13 00:01-0800\n" 14 | "PO-Revision-Date: 2017-09-19 16:05+0000\n" 15 | "Last-Translator: wwj402 \n" 16 | "Language-Team: Chinese (China) (http://www.transifex.com/fcitx/fcitx/" 17 | "language/zh_CN/)\n" 18 | "Language: zh_CN\n" 19 | "MIME-Version: 1.0\n" 20 | "Content-Type: text/plain; charset=UTF-8\n" 21 | "Content-Transfer-Encoding: 8bit\n" 22 | "Plural-Forms: nplurals=1; plural=0;\n" 23 | 24 | #: gui/adddictdialog.cpp:37 25 | msgid "&Host:" 26 | msgstr "主机(&H):" 27 | 28 | #: gui/adddictdialog.cpp:36 29 | msgid "&Path:" 30 | msgstr "路径(&P):" 31 | 32 | #: gui/adddictdialog.cpp:38 33 | msgid "&Port:" 34 | msgstr "端口(&P):" 35 | 36 | #: gui/dictwidget.cpp:34 37 | msgid "&Rule:" 38 | msgstr "按键方案(&R):" 39 | 40 | #: gui/adddictdialog.cpp:35 41 | msgid "&Type:" 42 | msgstr "类型(&T):" 43 | 44 | #: src/fcitx-skk.desc:60 45 | msgid "ABC (a,b,c,...)" 46 | msgstr "字母(a,b,c,...)" 47 | 48 | #: src/fcitx-skk.desc:36 49 | msgid "Candidate List Layout" 50 | msgstr "候选词列表" 51 | 52 | #: gui/dictwidget.cpp:61 53 | msgid "Dictionary Manager" 54 | msgstr "词典管理器" 55 | 56 | #: src/fcitx-skk.conf.in:9 57 | msgid "Dictionary and Rule" 58 | msgstr "词典和规则" 59 | 60 | #: src/fcitx-skk.desc:59 61 | msgid "Digit (0,1,2,...)" 62 | msgstr "数字(0,1,2,...)" 63 | 64 | #: src/fcitx-skk.desc:19 65 | msgid "Direct input" 66 | msgstr "直接输入" 67 | 68 | #: src/fcitx-skk.desc:1 src/fcitx-skk.desc:11 src/fcitx-skk.desc:22 69 | #: src/fcitx-skk.desc:29 src/fcitx-skk.desc:34 src/fcitx-skk.desc:43 70 | #: src/fcitx-skk.desc:50 src/fcitx-skk.desc:55 71 | msgid "General" 72 | msgstr "常规" 73 | 74 | #: src/fcitx-skk.desc:38 75 | msgid "Global" 76 | msgstr "全局" 77 | 78 | #: src/skk.c:97 src/fcitx-skk.desc:18 79 | msgid "Half width Katakana" 80 | msgstr "半角片假名" 81 | 82 | #: src/skk.c:95 src/fcitx-skk.desc:16 83 | msgid "Hiragana" 84 | msgstr "平假名" 85 | 86 | #: src/fcitx-skk.desc:40 87 | msgid "Horizontal" 88 | msgstr "横向" 89 | 90 | #: src/fcitx-skk.desc:13 91 | msgid "Initial Input Mode" 92 | msgstr "初始输入模式" 93 | 94 | #: src/skk.c:466 95 | msgid "Input Mode" 96 | msgstr "输入模式" 97 | 98 | #: src/fcitx-skk.desc:6 99 | msgid "Japanese" 100 | msgstr "日语" 101 | 102 | #: src/skk.c:96 src/fcitx-skk.desc:17 103 | msgid "Katakana" 104 | msgstr "片假名" 105 | 106 | #: src/fcitx-skk.desc:57 107 | msgid "Keys to Select from Candidate Window" 108 | msgstr "从候选窗口选择要选的键" 109 | 110 | #: src/skk.c:98 src/fcitx-skk.desc:7 111 | msgid "Latin" 112 | msgstr "英文" 113 | 114 | #: src/fcitx-skk.desc:45 115 | msgid "Number candidate of Triggers To Show Candidate Window" 116 | msgstr "触发显示候选词窗口的按键次数" 117 | 118 | #: src/fcitx-skk.desc:24 119 | msgid "Page size" 120 | msgstr "页面大小" 121 | 122 | #: src/fcitx-skk.desc:3 123 | msgid "Punctuation Style" 124 | msgstr "标点风格" 125 | 126 | #: src/fcitx-skk.desc:61 127 | msgid "Qwerty Center Row (a,s,d,...)" 128 | msgstr "Qwerty 键盘中心行 (a,s,d,...)" 129 | 130 | #: src/fcitx-skk.desc:31 131 | msgid "Return-key does not insert new line on commit" 132 | msgstr "回车提交时不插入新行" 133 | 134 | #: gui/adddictdialog.cpp:101 gui/adddictdialog.cpp:113 135 | msgid "Select Dictionary File" 136 | msgstr "选择词典文件" 137 | 138 | #: gui/adddictdialog.cpp:41 139 | msgid "Server" 140 | msgstr "服务器" 141 | 142 | #: src/fcitx-skk.desc:52 143 | msgid "Show Annotation" 144 | msgstr "显示注释" 145 | 146 | #: src/skk.c:440 src/fcitx-skk.conf.in:3 src/skk.conf.in:3 147 | msgid "Skk" 148 | msgstr "Skk" 149 | 150 | #: src/fcitx-skk.conf.in:4 151 | msgid "Skk Input Method For Fcitx" 152 | msgstr "Fcitx 的 Skk 日语输入法" 153 | 154 | #: gui/adddictdialog.cpp:39 155 | msgid "System" 156 | msgstr "系统" 157 | 158 | #: gui/adddictdialog.cpp:40 159 | msgid "User" 160 | msgstr "用户" 161 | 162 | #: src/fcitx-skk.desc:39 163 | msgid "Vertical" 164 | msgstr "纵向" 165 | 166 | #: src/skk.c:99 src/fcitx-skk.desc:8 src/fcitx-skk.desc:20 167 | msgid "Wide latin" 168 | msgstr "全角英文" 169 | 170 | #: src/fcitx-skk.desc:9 171 | msgid "Wide latin Japanese" 172 | msgstr "全角英文日语" 173 | -------------------------------------------------------------------------------- /po/zh_TW.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER 3 | # This file is distributed under the same license as the PACKAGE package. 4 | # 5 | # Translators: 6 | # BrLi , 2014 7 | # 黃柏諺 , 2015 8 | msgid "" 9 | msgstr "" 10 | "Project-Id-Version: fcitx\n" 11 | "Report-Msgid-Bugs-To: fcitx-dev@googlegroups.com\n" 12 | "POT-Creation-Date: 2020-01-13 00:01-0800\n" 13 | "PO-Revision-Date: 2017-09-19 16:05+0000\n" 14 | "Last-Translator: 黃柏諺 \n" 15 | "Language-Team: Chinese (Taiwan) (http://www.transifex.com/fcitx/fcitx/" 16 | "language/zh_TW/)\n" 17 | "Language: zh_TW\n" 18 | "MIME-Version: 1.0\n" 19 | "Content-Type: text/plain; charset=UTF-8\n" 20 | "Content-Transfer-Encoding: 8bit\n" 21 | "Plural-Forms: nplurals=1; plural=0;\n" 22 | 23 | #: gui/adddictdialog.cpp:37 24 | msgid "&Host:" 25 | msgstr "主機(&H):" 26 | 27 | #: gui/adddictdialog.cpp:36 28 | msgid "&Path:" 29 | msgstr "路徑(&P):" 30 | 31 | #: gui/adddictdialog.cpp:38 32 | msgid "&Port:" 33 | msgstr "埠口(&P):" 34 | 35 | #: gui/dictwidget.cpp:34 36 | msgid "&Rule:" 37 | msgstr "按鍵方案(&R):" 38 | 39 | #: gui/adddictdialog.cpp:35 40 | msgid "&Type:" 41 | msgstr "類型(&T):" 42 | 43 | #: src/fcitx-skk.desc:60 44 | msgid "ABC (a,b,c,...)" 45 | msgstr "ABC (a,b,c,...)" 46 | 47 | #: src/fcitx-skk.desc:36 48 | msgid "Candidate List Layout" 49 | msgstr "候選詞清單" 50 | 51 | #: gui/dictwidget.cpp:61 52 | msgid "Dictionary Manager" 53 | msgstr "字典管理員" 54 | 55 | #: src/fcitx-skk.conf.in:9 56 | msgid "Dictionary and Rule" 57 | msgstr "字典與規則" 58 | 59 | #: src/fcitx-skk.desc:59 60 | msgid "Digit (0,1,2,...)" 61 | msgstr "數字鍵 (0,1,2,...)" 62 | 63 | #: src/fcitx-skk.desc:19 64 | msgid "Direct input" 65 | msgstr "直接輸入" 66 | 67 | #: src/fcitx-skk.desc:1 src/fcitx-skk.desc:11 src/fcitx-skk.desc:22 68 | #: src/fcitx-skk.desc:29 src/fcitx-skk.desc:34 src/fcitx-skk.desc:43 69 | #: src/fcitx-skk.desc:50 src/fcitx-skk.desc:55 70 | msgid "General" 71 | msgstr "一般" 72 | 73 | #: src/fcitx-skk.desc:38 74 | msgid "Global" 75 | msgstr "全域" 76 | 77 | #: src/skk.c:97 src/fcitx-skk.desc:18 78 | msgid "Half width Katakana" 79 | msgstr "半形片假名" 80 | 81 | #: src/skk.c:95 src/fcitx-skk.desc:16 82 | msgid "Hiragana" 83 | msgstr "平假名" 84 | 85 | #: src/fcitx-skk.desc:40 86 | msgid "Horizontal" 87 | msgstr "橫向" 88 | 89 | #: src/fcitx-skk.desc:13 90 | msgid "Initial Input Mode" 91 | msgstr "初始輸入模式" 92 | 93 | #: src/skk.c:466 94 | msgid "Input Mode" 95 | msgstr "輸入模式" 96 | 97 | #: src/fcitx-skk.desc:6 98 | msgid "Japanese" 99 | msgstr "日語" 100 | 101 | #: src/skk.c:96 src/fcitx-skk.desc:17 102 | msgid "Katakana" 103 | msgstr "片假名" 104 | 105 | #: src/fcitx-skk.desc:57 106 | msgid "Keys to Select from Candidate Window" 107 | msgstr "從候選詞視窗選取的按鍵" 108 | 109 | #: src/skk.c:98 src/fcitx-skk.desc:7 110 | msgid "Latin" 111 | msgstr "英文" 112 | 113 | #: src/fcitx-skk.desc:45 114 | msgid "Number candidate of Triggers To Show Candidate Window" 115 | msgstr "觸發顯示候選字視窗的按鍵次數" 116 | 117 | #: src/fcitx-skk.desc:24 118 | msgid "Page size" 119 | msgstr "頁面大小" 120 | 121 | #: src/fcitx-skk.desc:3 122 | msgid "Punctuation Style" 123 | msgstr "標點風格" 124 | 125 | #: src/fcitx-skk.desc:61 126 | msgid "Qwerty Center Row (a,s,d,...)" 127 | msgstr "Qwerty 中心列 (a,s,d,...)" 128 | 129 | #: src/fcitx-skk.desc:31 130 | msgid "Return-key does not insert new line on commit" 131 | msgstr "確認送出時 Enter 鍵不輸入新行" 132 | 133 | #: gui/adddictdialog.cpp:101 gui/adddictdialog.cpp:113 134 | msgid "Select Dictionary File" 135 | msgstr "選擇字典檔案" 136 | 137 | #: gui/adddictdialog.cpp:41 138 | msgid "Server" 139 | msgstr "伺服器" 140 | 141 | #: src/fcitx-skk.desc:52 142 | msgid "Show Annotation" 143 | msgstr "顯示注釋" 144 | 145 | #: src/skk.c:440 src/fcitx-skk.conf.in:3 src/skk.conf.in:3 146 | msgid "Skk" 147 | msgstr "Skk" 148 | 149 | #: src/fcitx-skk.conf.in:4 150 | msgid "Skk Input Method For Fcitx" 151 | msgstr "Fcitx 的 Skk 日語輸入法" 152 | 153 | #: gui/adddictdialog.cpp:39 154 | msgid "System" 155 | msgstr "系統" 156 | 157 | #: gui/adddictdialog.cpp:40 158 | msgid "User" 159 | msgstr "使用者" 160 | 161 | #: src/fcitx-skk.desc:39 162 | msgid "Vertical" 163 | msgstr "縱向" 164 | 165 | #: src/skk.c:99 src/fcitx-skk.desc:8 src/fcitx-skk.desc:20 166 | msgid "Wide latin" 167 | msgstr "全形英文" 168 | 169 | #: src/fcitx-skk.desc:9 170 | msgid "Wide latin Japanese" 171 | msgstr "全形拉丁日語" 172 | -------------------------------------------------------------------------------- /src/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include_directories(${FCITX4_FCITX_INCLUDE_DIRS}) 2 | include_directories(${FCITX4_FCITX_CONFIG_INCLUDE_DIRS}) 3 | include_directories(${FCITX4_FCITX_UTILS_INCLUDE_DIRS}) 4 | include_directories(${LIBSKK_INCLUDE_DIRS}) 5 | link_directories(${LIBSKK_LIBRARY_DIRS}) 6 | 7 | set(fcitx_skk_sources 8 | skk.c skk-config.c) 9 | fcitx_add_addon_full(skk 10 | DESC 11 | SOURCES ${fcitx_skk_sources} 12 | IM_CONFIG skk.conf 13 | LINK_LIBS ${LIBSKK_LIBRARIES} 14 | EXTRA_PO skk.h) 15 | 16 | configure_file(${CMAKE_CURRENT_SOURCE_DIR}/dictionary_list.in ${CMAKE_CURRENT_BINARY_DIR}/dictionary_list @ONLY) 17 | 18 | install(FILES ${CMAKE_CURRENT_BINARY_DIR}/dictionary_list rule DESTINATION "${FCITX4_PREFIX}/share/fcitx/skk") 19 | -------------------------------------------------------------------------------- /src/dictionary_list.in: -------------------------------------------------------------------------------- 1 | type=file,file=$FCITX_CONFIG_DIR/skk/user.dict,mode=readwrite 2 | type=file,file=@SKK_DEFAULT_PATH@,mode=readonly 3 | -------------------------------------------------------------------------------- /src/fcitx-skk.conf.in: -------------------------------------------------------------------------------- 1 | [Addon] 2 | Name=fcitx-skk 3 | _GeneralName=Skk 4 | _Comment=Skk Input Method For Fcitx 5 | Category=InputMethod 6 | Enabled=True 7 | Library=fcitx-skk.so 8 | Type=SharedLibrary 9 | SubConfig=Dictionary and Rule:native:skk/dictionary_list,fcitx-skk:domain 10 | IMRegisterMethod=ConfigFile 11 | -------------------------------------------------------------------------------- /src/fcitx-skk.desc: -------------------------------------------------------------------------------- 1 | [General/PunctuationStyle] 2 | Type=Enum 3 | Description=Punctuation Style 4 | DefaultValue=Japanese 5 | EnumCount=4 6 | Enum0=Japanese 7 | Enum1=Latin 8 | Enum2=Wide latin 9 | Enum3=Wide latin Japanese 10 | 11 | [General/InitialInputMode] 12 | Type=Enum 13 | Description=Initial Input Mode 14 | DefaultValue=Hiragana 15 | EnumCount=5 16 | Enum0=Hiragana 17 | Enum1=Katakana 18 | Enum2=Half width Katakana 19 | Enum3=Direct input 20 | Enum4=Wide latin 21 | 22 | [General/PageSize] 23 | Type=Integer 24 | Description=Page size 25 | DefaultValue=7 26 | Min=1 27 | Max=10 28 | 29 | [General/EggLikeNewLine] 30 | Type=Boolean 31 | Description=Return-key does not insert new line on commit 32 | DefaultValue=False 33 | 34 | [General/CandidateLayout] 35 | Type=Enum 36 | Description=Candidate List Layout 37 | EnumCount=3 38 | Enum0=Global 39 | Enum1=Vertical 40 | Enum2=Horizontal 41 | DefaultValue=Vertical 42 | 43 | [General/NTriggersToShowCandWin] 44 | Type=Integer 45 | Description=Number candidate of Triggers To Show Candidate Window 46 | DefaultValue=4 47 | Min=0 48 | Max=7 49 | 50 | [General/ShowAnnotation] 51 | Type=Boolean 52 | Description=Show Annotation 53 | DefaultValue=True 54 | 55 | [General/CandidateChooseKey] 56 | Type=Enum 57 | Description=Keys to Select from Candidate Window 58 | EnumCount=3 59 | Enum0=Digit (0,1,2,...) 60 | Enum1=ABC (a,b,c,...) 61 | Enum2=Qwerty Center Row (a,s,d,...) 62 | DefaultValue=Digit (0,1,2,...) 63 | 64 | 65 | [DescriptionFile] 66 | LocaleDomain=fcitx-skk 67 | -------------------------------------------------------------------------------- /src/rule: -------------------------------------------------------------------------------- 1 | default 2 | -------------------------------------------------------------------------------- /src/skk-config.c: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2013~2013 by CSSlayer * 3 | * wengxt@gmail.com * 4 | * * 5 | * This program is free software: you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation, either version 3 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program. If not, see . * 17 | * * 18 | ***************************************************************************/ 19 | 20 | #include "skk.h" 21 | 22 | CONFIG_BINDING_BEGIN(FcitxSkkConfig) 23 | CONFIG_BINDING_REGISTER("General", "PunctuationStyle", punctuationStyle) 24 | CONFIG_BINDING_REGISTER("General", "InitialInputMode", initialInputMode) 25 | CONFIG_BINDING_REGISTER("General", "PageSize", pageSize) 26 | CONFIG_BINDING_REGISTER("General", "CandidateLayout", candidateLayout) 27 | CONFIG_BINDING_REGISTER("General", "NTriggersToShowCandWin", nTriggersToShowCandWin) 28 | CONFIG_BINDING_REGISTER("General", "ShowAnnotation", showAnnotation) 29 | CONFIG_BINDING_REGISTER("General", "EggLikeNewLine", eggLikeNewLine) 30 | CONFIG_BINDING_REGISTER("General", "CandidateChooseKey", candidateChooseKey) /* candidate selection keys */ 31 | CONFIG_BINDING_END() 32 | -------------------------------------------------------------------------------- /src/skk.c: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2012~2012 by Yichao Yu * 3 | * yyc1992@gmail.com * 4 | * Copyright (C) 2012~2013 by Weng Xuetian * 5 | * wengxt@gmail.com * 6 | * * 7 | * This program is free software; you can redistribute it and/or modify * 8 | * it under the terms of the GNU General Public License as published by * 9 | * the Free Software Foundation; either version 2 of the License, or * 10 | * (at your option) any later version. * 11 | * * 12 | * This program is distributed in the hope that it will be useful, * 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 15 | * GNU General Public License for more details. * 16 | * * 17 | * You should have received a copy of the GNU General Public License * 18 | * along with this program; if not, write to the * 19 | * Free Software Foundation, Inc., * 20 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * 21 | ***************************************************************************/ 22 | 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | 38 | #include "skk.h" 39 | #include "config.h" 40 | 41 | UT_icd dict_icd = { sizeof(void*), 0, 0, 0}; 42 | 43 | static void *FcitxSkkCreate(FcitxInstance *instance); 44 | static void FcitxSkkDestroy(void *arg); 45 | static void FcitxSkkReloadConfig(void *arg); 46 | static boolean FcitxSkkLoadDictionary(FcitxSkk* skk); 47 | static boolean FcitxSkkLoadRule(FcitxSkk* skk); 48 | static void FcitxSkkApplyConfig(FcitxSkk* skk); 49 | 50 | CONFIG_DEFINE_LOAD_AND_SAVE(Skk, FcitxSkkConfig, "fcitx-skk") 51 | 52 | static boolean FcitxSkkInit(void *arg); 53 | static INPUT_RETURN_VALUE FcitxSkkDoInputReal(void *arg, FcitxKeySym sym, 54 | unsigned int state); 55 | static INPUT_RETURN_VALUE FcitxSkkDoInput(void *arg, FcitxKeySym sym, 56 | unsigned int state); 57 | static INPUT_RETURN_VALUE FcitxSkkDoReleaseInput(void *arg, FcitxKeySym sym, 58 | unsigned int state); 59 | static INPUT_RETURN_VALUE FcitxSkkDoCandidate(void *arg, FcitxKeySym sym, 60 | unsigned int state); 61 | static INPUT_RETURN_VALUE FcitxSkkGetCandWords(void *arg); 62 | static void FcitxSkkReset(void *arg); 63 | 64 | FCITX_DEFINE_PLUGIN(fcitx_skk, ime2, FcitxIMClass2) = { 65 | FcitxSkkCreate, 66 | FcitxSkkDestroy, 67 | FcitxSkkReloadConfig, 68 | NULL, 69 | NULL, 70 | NULL, 71 | NULL, 72 | NULL 73 | }; 74 | 75 | static const FcitxIMIFace skk_iface = { 76 | .Init = FcitxSkkInit, 77 | .ResetIM = FcitxSkkReset, 78 | .DoInput = FcitxSkkDoInput, 79 | .GetCandWords = FcitxSkkGetCandWords, 80 | .PhraseTips = NULL, 81 | .Save = NULL, 82 | .ReloadConfig = NULL, 83 | .KeyBlocker = 0, 84 | .UpdateSurroundingText = NULL, 85 | .DoReleaseInput = FcitxSkkDoReleaseInput, 86 | }; 87 | 88 | typedef struct _SkkStatus { 89 | const char* icon; 90 | const char* label; 91 | const char* description; 92 | } SkkStatus; 93 | 94 | SkkStatus input_mode_status[] = { 95 | {"", "\xe3\x81\x82", N_("Hiragana") }, 96 | {"", "\xe3\x82\xa2", N_("Katakana") }, 97 | {"", "\xef\xbd\xb1", N_("Half width Katakana") }, 98 | {"", "A", N_("Latin") }, 99 | {"", "\xef\xbc\xa1", N_("Wide latin") }, 100 | }; 101 | 102 | static void 103 | ut_gobject_cpy(void *dst, const void *src) 104 | { 105 | GObject *const *_src = (GObject *const*)src; 106 | GObject **_dst = (GObject**)dst; 107 | *_dst = g_object_ref(*_src); 108 | } 109 | 110 | static void 111 | ut_gobject_dtor(void *self) 112 | { 113 | GObject **_self = (GObject**)self; 114 | g_object_unref(*_self); 115 | } 116 | 117 | static const UT_icd gobject_icd = { 118 | .sz = sizeof(GObject*), 119 | .dtor = ut_gobject_dtor, 120 | .copy = ut_gobject_cpy, 121 | }; 122 | 123 | void skk_candidate_update_preedit_cb (SkkContext* context, GParamSpec *pspec, gpointer user_data) 124 | { 125 | FcitxSkk *skk = (FcitxSkk*) user_data; 126 | skk->updatePreedit = true; 127 | } 128 | 129 | void skk_candidate_list_selected_cb (SkkCandidateList* self, SkkCandidate* c, gpointer user_data) 130 | { 131 | FcitxSkk *skk = (FcitxSkk*) user_data; 132 | skk->selected = true; 133 | gchar* output = skk_context_poll_output(skk->context); 134 | 135 | if (output && strlen(output) > 0) { 136 | FcitxInstanceCommitString(skk->owner, FcitxInstanceGetCurrentIC(skk->owner), output); 137 | } 138 | 139 | g_free(output); 140 | } 141 | 142 | void skk_candidate_list_popuplated_cb (SkkCandidateList* self, gpointer user_data) 143 | { 144 | FcitxSkk *skk = (FcitxSkk*) user_data; 145 | skk->update_candidate = true; 146 | } 147 | 148 | static gboolean skk_context_retrieve_surrounding_text_cb (SkkContext* self, gchar** text, guint* cursor_pos, gpointer user_data) { 149 | FcitxSkk *skk = (FcitxSkk*) user_data; 150 | FcitxInputContext* ic = FcitxInstanceGetCurrentIC(skk->owner); 151 | if (!ic || !(ic->contextCaps & CAPACITY_SURROUNDING_TEXT)) 152 | return false; 153 | 154 | char* _text = NULL; 155 | unsigned int _cursor_pos; 156 | if (!FcitxInstanceGetSurroundingText(skk->owner, ic, &_text, &_cursor_pos, NULL)) 157 | return false; 158 | 159 | *text = g_strdup(_text); 160 | *cursor_pos = _cursor_pos; 161 | 162 | fcitx_utils_free(_text); 163 | 164 | return true; 165 | } 166 | 167 | static gboolean skk_context_delete_surrounding_text_cb (SkkContext* self, gint offset, guint nchars, gpointer user_data) { 168 | FcitxSkk *skk = (FcitxSkk*) user_data; 169 | FcitxInputContext* ic = FcitxInstanceGetCurrentIC(skk->owner); 170 | if (!ic || !(ic->contextCaps & CAPACITY_SURROUNDING_TEXT)) 171 | return false; 172 | FcitxInstanceDeleteSurroundingText(skk->owner, ic, offset, nchars); 173 | return true; 174 | } 175 | 176 | typedef enum _FcitxSkkDictType { 177 | FSDT_Invalid, 178 | FSDT_File, 179 | FSTD_Server 180 | } FcitxSkkDictType; 181 | 182 | 183 | void FcitxSkkResetHook(void *arg) 184 | { 185 | FcitxSkk *skk = (FcitxSkk*)arg; 186 | FcitxIM* im = FcitxInstanceGetCurrentIM(skk->owner); 187 | #define RESET_STATUS(STATUS_NAME) \ 188 | if (im && strcmp(im->uniqueName, "skk") == 0) \ 189 | FcitxUISetStatusVisable(skk->owner, STATUS_NAME, true); \ 190 | else \ 191 | FcitxUISetStatusVisable(skk->owner, STATUS_NAME, false); 192 | 193 | RESET_STATUS("skk-input-mode") 194 | } 195 | 196 | boolean FcitxSkkLoadDictionary(FcitxSkk* skk) 197 | { 198 | FILE* fp = FcitxXDGGetFileWithPrefix("skk", "dictionary_list", "r", NULL); 199 | if (!fp) { 200 | return false; 201 | } 202 | 203 | UT_array dictionaries; 204 | utarray_init(&dictionaries, &dict_icd); 205 | 206 | char *buf = NULL; 207 | size_t len = 0; 208 | char *trimmed = NULL; 209 | 210 | while (getline(&buf, &len, fp) != -1) { 211 | if (trimmed) 212 | free(trimmed); 213 | trimmed = fcitx_utils_trim(buf); 214 | 215 | UT_array* list = fcitx_utils_split_string(trimmed, ','); 216 | do { 217 | if (utarray_len(list) < 3) { 218 | break; 219 | } 220 | 221 | FcitxSkkDictType type = FSDT_Invalid; 222 | int mode = 0; 223 | char* path = NULL; 224 | char* host = NULL; 225 | char* port = NULL; 226 | char* encoding = NULL; 227 | utarray_foreach(item, list, char*) { 228 | char* key = *item; 229 | char* value = strchr(*item, '='); 230 | if (!value) 231 | continue; 232 | *value = '\0'; 233 | value++; 234 | 235 | if (strcmp(key, "type") == 0) { 236 | if (strcmp(value, "file") == 0) { 237 | type = FSDT_File; 238 | } else if (strcmp(value, "server") == 0) { 239 | type = FSTD_Server; 240 | } 241 | } else if (strcmp(key, "file") == 0) { 242 | path = value; 243 | } else if (strcmp(key, "mode") == 0) { 244 | if (strcmp(value, "readonly") == 0) { 245 | mode = 1; 246 | } else if (strcmp(value, "readwrite") == 0) { 247 | mode = 2; 248 | } 249 | } else if (strcmp(key, "host") == 0) { 250 | host = value; 251 | } else if (strcmp(key, "port") == 0) { 252 | port = value; 253 | } else if (strcmp(key, "encoding") == 0) { 254 | encoding = value; 255 | } 256 | } 257 | 258 | encoding = encoding ? encoding : "EUC-JP"; 259 | 260 | if (type == FSDT_Invalid) { 261 | break; 262 | } else if (type == FSDT_File) { 263 | if (path == NULL || mode == 0) { 264 | break; 265 | } 266 | if (mode == 1) { 267 | if(strlen(path) > 4 && !strcmp(path + strlen(path) - 4, ".cdb")) { 268 | SkkCdbDict* dict = skk_cdb_dict_new(path, encoding, NULL); 269 | if (dict) { 270 | utarray_push_back(&dictionaries, &dict); 271 | } 272 | } else { 273 | SkkFileDict* dict = skk_file_dict_new(path, encoding, NULL); 274 | if (dict) { 275 | utarray_push_back(&dictionaries, &dict); 276 | } 277 | } 278 | } else { 279 | char* needfree = NULL; 280 | char* realpath = NULL; 281 | if (strncmp(path, "$FCITX_CONFIG_DIR/", strlen("$FCITX_CONFIG_DIR/")) == 0) { 282 | FcitxXDGGetFileUserWithPrefix("", path + strlen("$FCITX_CONFIG_DIR/"), NULL, &needfree); 283 | realpath = needfree; 284 | } else { 285 | realpath = path; 286 | } 287 | SkkUserDict* userdict = skk_user_dict_new(realpath, encoding, NULL); 288 | if (needfree) { 289 | free(needfree); 290 | } 291 | if (userdict) { 292 | utarray_push_back(&dictionaries, &userdict); 293 | } 294 | } 295 | } else if (type == FSTD_Server) { 296 | host = host ? host : "localhost"; 297 | port = port ? port : "1178"; 298 | 299 | errno = 0; 300 | int iPort = atoi(port); 301 | if (iPort <= 0 || iPort > UINT16_MAX) { 302 | break; 303 | } 304 | 305 | SkkSkkServ* dict = skk_skk_serv_new(host, iPort, encoding, NULL); 306 | if (dict) { 307 | utarray_push_back(&dictionaries, &dict); 308 | } 309 | } 310 | 311 | } while(0); 312 | fcitx_utils_free_string_list(list); 313 | } 314 | 315 | if (buf) 316 | free(buf); 317 | if (trimmed) 318 | free(trimmed); 319 | 320 | boolean result = false; 321 | if (utarray_len(&dictionaries) != 0) { 322 | result = true; 323 | skk_context_set_dictionaries(skk->context, 324 | (SkkDict**)utarray_front(&dictionaries), 325 | utarray_len(&dictionaries)); 326 | } 327 | 328 | utarray_done(&dictionaries); 329 | return result; 330 | } 331 | 332 | boolean FcitxSkkLoadRule(FcitxSkk* skk) 333 | { 334 | FILE* fp = FcitxXDGGetFileWithPrefix("skk", "rule", "r", NULL); 335 | SkkRuleMetadata* meta = NULL; 336 | 337 | do { 338 | if (!fp) { 339 | break; 340 | } 341 | 342 | char* line = NULL; 343 | size_t bufsize = 0; 344 | getline(&line, &bufsize, fp); 345 | fclose(fp); 346 | 347 | if (!line) { 348 | break; 349 | } 350 | 351 | char* trimmed = fcitx_utils_trim(line); 352 | meta = skk_rule_find_rule(trimmed); 353 | free(trimmed); 354 | free(line); 355 | } while(0); 356 | 357 | if (!meta) { 358 | meta = skk_rule_find_rule("default"); 359 | if (!meta) { 360 | return false; 361 | } 362 | } 363 | 364 | SkkRule* rule = skk_rule_new(meta->name, NULL); 365 | if (!rule) { 366 | return false; 367 | } 368 | 369 | skk_context_set_typing_rule(skk->context, rule); 370 | return true; 371 | } 372 | 373 | 374 | const char* FcitxSkkGetInputModeIconName(void* arg) 375 | { 376 | FcitxSkk *skk = (FcitxSkk*)arg; 377 | return input_mode_status[skk_context_get_input_mode(skk->context)].icon; 378 | } 379 | 380 | void FcitxSkkUpdateInputModeMenu(struct _FcitxUIMenu *menu) 381 | { 382 | FcitxSkk *skk = (FcitxSkk*) menu->priv; 383 | menu->mark = skk_context_get_input_mode(skk->context); 384 | } 385 | 386 | boolean FcitxSkkInputModeMenuAction(struct _FcitxUIMenu *menu, int index) 387 | { 388 | FcitxSkk *skk = (FcitxSkk*) menu->priv; 389 | skk_context_set_input_mode(skk->context, (SkkInputMode) index); 390 | return true; 391 | } 392 | 393 | void FcitxSkkUpdateInputMode(FcitxSkk* skk) 394 | { 395 | SkkInputMode mode = skk_context_get_input_mode(skk->context); 396 | FcitxUISetStatusString(skk->owner, 397 | "skk-input-mode", 398 | _(input_mode_status[mode].label), 399 | _(input_mode_status[mode].description)); 400 | } 401 | 402 | static void _skk_input_mode_changed_cb (GObject *gobject, 403 | GParamSpec *pspec, 404 | gpointer user_data) 405 | { 406 | FcitxSkk *skk = (FcitxSkk*) user_data; 407 | FcitxSkkUpdateInputMode(skk); 408 | } 409 | 410 | static void* 411 | FcitxSkkCreate(FcitxInstance *instance) 412 | { 413 | FcitxSkk *skk = fcitx_utils_new(FcitxSkk); 414 | bindtextdomain("fcitx-skk", LOCALEDIR); 415 | bind_textdomain_codeset("fcitx-skk", "UTF-8"); 416 | skk->owner = instance; 417 | 418 | if (!SkkLoadConfig(&skk->config)) { 419 | free(skk); 420 | return NULL; 421 | } 422 | 423 | #if !GLIB_CHECK_VERSION(2, 36, 0) 424 | g_type_init(); 425 | #endif 426 | 427 | skk_init(); 428 | 429 | skk->context = skk_context_new(0, 0); 430 | 431 | if (!FcitxSkkLoadDictionary(skk) || !FcitxSkkLoadRule(skk)) { 432 | free(skk); 433 | return NULL; 434 | } 435 | skk_context_set_period_style(skk->context, SKK_PERIOD_STYLE_JA_JA); 436 | skk_context_set_input_mode(skk->context, SKK_INPUT_MODE_HIRAGANA); 437 | 438 | FcitxSkkApplyConfig(skk); 439 | 440 | FcitxInstanceRegisterIMv2(instance, skk, "skk", _("Skk"), "skk", 441 | skk_iface, 1, "ja"); 442 | 443 | #define INIT_MENU(VARNAME, NAME, I18NNAME, STATUS_NAME, STATUS_ARRAY, SIZE) \ 444 | do { \ 445 | FcitxUIRegisterComplexStatus(instance, skk, \ 446 | STATUS_NAME, \ 447 | I18NNAME, \ 448 | I18NNAME, \ 449 | NULL, \ 450 | FcitxSkkGet##NAME##IconName \ 451 | ); \ 452 | FcitxMenuInit(&VARNAME); \ 453 | VARNAME.name = strdup(I18NNAME); \ 454 | VARNAME.candStatusBind = strdup(STATUS_NAME); \ 455 | VARNAME.UpdateMenu = FcitxSkkUpdate##NAME##Menu; \ 456 | VARNAME.MenuAction = FcitxSkk##NAME##MenuAction; \ 457 | VARNAME.priv = skk; \ 458 | VARNAME.isSubMenu = false; \ 459 | int i; \ 460 | for (i = 0; i < SIZE; i ++) \ 461 | FcitxMenuAddMenuItem(&VARNAME, _(STATUS_ARRAY[i].label), MENUTYPE_SIMPLE, NULL); \ 462 | FcitxUIRegisterMenu(instance, &VARNAME); \ 463 | FcitxUISetStatusVisable(instance, STATUS_NAME, false); \ 464 | } while(0) 465 | 466 | INIT_MENU(skk->inputModeMenu, InputMode, _("Input Mode"), "skk-input-mode", input_mode_status, SKK_INPUT_MODE_LAST); 467 | 468 | skk->handler = g_signal_connect(skk->context, "notify::input-mode", G_CALLBACK(_skk_input_mode_changed_cb), skk); 469 | FcitxSkkUpdateInputMode(skk); 470 | skk->candidate_selected_handler = g_signal_connect(skk_context_get_candidates(skk->context), "selected", G_CALLBACK(skk_candidate_list_selected_cb), skk); 471 | skk->candidate_populated_handler = g_signal_connect(skk_context_get_candidates(skk->context), "populated", G_CALLBACK(skk_candidate_list_popuplated_cb), skk); 472 | skk->notify_preedit_handler = g_signal_connect(skk->context, "notify::preedit", G_CALLBACK(skk_candidate_update_preedit_cb), skk); 473 | skk->retrieve_surrounding_text_handler = g_signal_connect(skk->context, "retrieve_surrounding_text", G_CALLBACK(skk_context_retrieve_surrounding_text_cb), skk); 474 | skk->delete_surrounding_text_handler = g_signal_connect(skk->context, "delete_surrounding_text", G_CALLBACK(skk_context_delete_surrounding_text_cb), skk); 475 | 476 | 477 | gchar* AUTO_START_HENKAN_KEYWORDS[] = { 478 | "を", "、", "。", ".", ",", "?", "」", 479 | "!", ";", ":", ")", ";", ":", ")", 480 | "”", "】", "』", "》", "〉", "}", "]", 481 | "〕", "}", "]", "?", ".", ",", "!" 482 | }; 483 | skk_context_set_auto_start_henkan_keywords(skk->context, AUTO_START_HENKAN_KEYWORDS, G_N_ELEMENTS(AUTO_START_HENKAN_KEYWORDS)); 484 | 485 | FcitxIMEventHook hk; 486 | hk.arg = skk; 487 | hk.func = FcitxSkkResetHook; 488 | FcitxInstanceRegisterResetInputHook(instance, hk); 489 | 490 | return skk; 491 | } 492 | 493 | 494 | 495 | static void 496 | FcitxSkkDestroy(void *arg) 497 | { 498 | FcitxSkk *skk = (FcitxSkk*)arg; 499 | if (fcitx_unlikely(!arg)) 500 | return; 501 | g_signal_handler_disconnect(skk_context_get_candidates(skk->context), skk->candidate_selected_handler); 502 | g_signal_handler_disconnect(skk_context_get_candidates(skk->context), skk->candidate_populated_handler); 503 | g_signal_handler_disconnect(skk->context, skk->handler); 504 | g_signal_handler_disconnect(skk->context, skk->notify_preedit_handler); 505 | g_signal_handler_disconnect(skk->context, skk->retrieve_surrounding_text_handler); 506 | g_signal_handler_disconnect(skk->context, skk->delete_surrounding_text_handler); 507 | g_object_unref(skk->context); 508 | free(arg); 509 | } 510 | 511 | static boolean 512 | FcitxSkkInit(void *arg) 513 | { 514 | FcitxSkk *skk = (FcitxSkk*)arg; 515 | if (!arg) 516 | return false; 517 | FcitxInstanceSetContext(skk->owner, CONTEXT_IM_KEYBOARD_LAYOUT, "ja"); 518 | boolean flag = true; 519 | FcitxInstanceSetContext(skk->owner, CONTEXT_IM_KEYBOARD_LAYOUT, "jp"); 520 | FcitxInstanceSetContext(skk->owner, CONTEXT_DISABLE_AUTOENG, &flag); 521 | FcitxInstanceSetContext(skk->owner, CONTEXT_DISABLE_QUICKPHRASE, &flag); 522 | FcitxInstanceSetContext(skk->owner, CONTEXT_DISABLE_FULLWIDTH, &flag); 523 | FcitxInstanceSetContext(skk->owner, CONTEXT_DISABLE_AUTO_FIRST_CANDIDATE_HIGHTLIGHT, &flag); 524 | return true; 525 | } 526 | 527 | static INPUT_RETURN_VALUE 528 | FcitxSkkDoInput(void *arg, FcitxKeySym sym, unsigned int state) 529 | { 530 | FcitxSkk *skk = (FcitxSkk*)arg; 531 | FcitxInputState* input = FcitxInstanceGetInputState(skk->owner); 532 | sym = FcitxInputStateGetKeySym(input); 533 | state = FcitxInputStateGetKeyState(input); 534 | 535 | return FcitxSkkDoInputReal(skk, sym, state); 536 | } 537 | 538 | static INPUT_RETURN_VALUE 539 | FcitxSkkDoInputReal(void *arg, FcitxKeySym sym, unsigned int state) 540 | { 541 | FcitxSkk *skk = (FcitxSkk*)arg; 542 | // Filter out unnecessary modifier bits 543 | // FIXME: should resolve virtual modifiers 544 | 545 | if (skk_candidate_list_get_page_visible(skk_context_get_candidates(skk->context))) { 546 | INPUT_RETURN_VALUE result = FcitxSkkDoCandidate (skk, sym, state); 547 | if (result == IRV_TO_PROCESS) 548 | return result; 549 | } 550 | 551 | SkkModifierType modifiers = (SkkModifierType) state & (FcitxKeyState_SimpleMask | (1 << 30)); 552 | SkkKeyEvent* key = skk_key_event_new_from_x_keysym(sym, modifiers, NULL); 553 | if (!key) 554 | return IRV_TO_PROCESS; 555 | 556 | gboolean retval = skk_context_process_key_event(skk->context, key); 557 | gchar* output = skk_context_poll_output(skk->context); 558 | 559 | g_object_unref(key); 560 | 561 | if (output && strlen(output) > 0) { 562 | FcitxInstanceCommitString(skk->owner, FcitxInstanceGetCurrentIC(skk->owner), output); 563 | } 564 | 565 | g_free(output); 566 | return retval ? (skk->updatePreedit || skk->update_candidate ? IRV_DISPLAY_CANDWORDS : IRV_DO_NOTHING) : IRV_TO_PROCESS; 567 | } 568 | 569 | static INPUT_RETURN_VALUE 570 | FcitxSkkDoReleaseInput(void *arg, FcitxKeySym sym, unsigned int state) 571 | { 572 | FcitxSkk *skk = (FcitxSkk*)arg; 573 | FcitxInputState* input = FcitxInstanceGetInputState(skk->owner); 574 | sym = FcitxInputStateGetKeySym(input); 575 | state = FcitxInputStateGetKeyState(input); 576 | 577 | return FcitxSkkDoInputReal(skk, sym, state | (1 << 30)); 578 | } 579 | 580 | INPUT_RETURN_VALUE FcitxSkkDoCandidate(void* arg, FcitxKeySym sym, unsigned int state) 581 | { 582 | FcitxSkk *skk = (FcitxSkk*)arg; 583 | FcitxInputState* input = FcitxInstanceGetInputState(skk->owner); 584 | FcitxGlobalConfig *fc = FcitxInstanceGetGlobalConfig(skk->owner); 585 | FcitxCandidateWordList* candList = FcitxInputStateGetCandidateList(input); 586 | 587 | if (FcitxHotkeyIsHotKey(sym, state, 588 | FcitxConfigPrevPageKey(skk->owner, fc))) { 589 | return IRV_TO_PROCESS; 590 | } else if (FcitxHotkeyIsHotKey(sym, state, 591 | FcitxConfigNextPageKey(skk->owner, fc))) { 592 | return IRV_TO_PROCESS; 593 | } else if (FcitxCandidateWordCheckChooseKey(candList, sym, state) >= 0) { 594 | return IRV_TO_PROCESS; 595 | } 596 | return IRV_DO_NOTHING; 597 | } 598 | 599 | static INPUT_RETURN_VALUE 600 | FcitxSkkGetCandWord(void* arg, FcitxCandidateWord* cand) 601 | { 602 | FcitxSkk *skk = (FcitxSkk*)arg; 603 | SkkCandidateList* skkCandList = skk_context_get_candidates(skk->context); 604 | int idx = *(int*) cand->priv; 605 | gboolean retval = skk_candidate_list_select_at(skkCandList, idx % skk_candidate_list_get_page_size(skkCandList)); 606 | if (retval) { 607 | return IRV_DISPLAY_CANDWORDS; 608 | } 609 | 610 | return IRV_TO_PROCESS; 611 | } 612 | 613 | boolean FcitxSkkPaging(void* arg, boolean prev) { 614 | FcitxSkk *skk = (FcitxSkk*)arg; 615 | SkkCandidateList* skkCandList = skk_context_get_candidates(skk->context); 616 | boolean result; 617 | if (prev) 618 | result = skk_candidate_list_page_up(skkCandList); 619 | else 620 | result = skk_candidate_list_page_down(skkCandList); 621 | FcitxSkkGetCandWords(skk); 622 | return result; 623 | } 624 | 625 | static INPUT_RETURN_VALUE 626 | FcitxSkkGetCandWords(void *arg) 627 | { 628 | FcitxSkk *skk = (FcitxSkk*)arg; 629 | FcitxInstanceCleanInputWindow(skk->owner); 630 | FcitxInputState* input = FcitxInstanceGetInputState(skk->owner); 631 | FcitxCandidateWordList* candList = FcitxInputStateGetCandidateList(input); 632 | SkkCandidateList* skkCandList = skk_context_get_candidates(skk->context); 633 | switch (skk->config.candidateChooseKey){ 634 | case ChooseABCD: 635 | FcitxCandidateWordSetChoose(candList, ABCD_STR_CHOOSE); 636 | break; 637 | case ChooseASDF: 638 | FcitxCandidateWordSetChoose(candList, ASDF_STR_CHOOSE); 639 | break; 640 | case ChooseDigit: 641 | // FALL THRU 642 | default: 643 | FcitxCandidateWordSetChoose(candList, DIGIT_STR_CHOOSE); 644 | break; 645 | } 646 | 647 | FcitxCandidateWordSetPageSize(candList, skk->config.pageSize); 648 | FcitxCandidateWordSetLayoutHint(candList, skk->config.candidateLayout); 649 | 650 | if (skk_candidate_list_get_page_visible(skkCandList)) { 651 | int i = 0; 652 | int j = 0; 653 | guint size = skk_candidate_list_get_size(skkCandList); 654 | gint cursor_pos = skk_candidate_list_get_cursor_pos(skkCandList); 655 | guint page_start = skk_candidate_list_get_page_start(skkCandList); 656 | guint page_size = skk_candidate_list_get_page_size(skkCandList); 657 | for (i = skk_candidate_list_get_page_start(skkCandList), j = 0; i < size; i ++, j++) { 658 | SkkCandidate* skkCandidate = skk_candidate_list_get(skkCandList, i); 659 | FcitxCandidateWord word; 660 | word.callback = FcitxSkkGetCandWord; 661 | word.extraType = MSG_OTHER; 662 | word.owner = skk; 663 | int* id = fcitx_utils_new(int); 664 | *id = j; 665 | word.priv = id; 666 | word.strExtra = NULL; 667 | if (skk->config.showAnnotation && skk_candidate_get_annotation(skkCandidate)) { 668 | fcitx_utils_alloc_cat_str(word.strExtra, " [", skk_candidate_get_annotation(skkCandidate), "]"); 669 | } 670 | word.strWord = strdup(skk_candidate_get_text(skkCandidate)); 671 | if (i == cursor_pos) { 672 | word.wordType = MSG_CANDIATE_CURSOR; 673 | } else { 674 | word.wordType = MSG_OTHER; 675 | } 676 | FcitxCandidateWordAppend(candList, &word); 677 | } 678 | FcitxCandidateWordSetFocus(candList, cursor_pos - page_start); 679 | FcitxCandidateWordSetOverridePaging(candList, (cursor_pos - page_start) >= page_size, (size - cursor_pos) >= page_size, FcitxSkkPaging, skk, NULL); 680 | } 681 | skk->update_candidate = false; 682 | 683 | FcitxMessages* preedit = (FcitxInstanceICSupportPreedit(skk->owner, FcitxInstanceGetCurrentIC(skk->owner))) 684 | ? FcitxInputStateGetClientPreedit(input) 685 | : FcitxInputStateGetPreedit(input); 686 | 687 | 688 | const gchar* preeditString = skk_context_get_preedit(skk->context); 689 | size_t len = strlen(preeditString); 690 | if (len > 0) { 691 | guint offset, nchars; 692 | skk_context_get_preedit_underline(skk->context, &offset, &nchars); 693 | 694 | if (nchars > 0) { 695 | const gchar* preeditString = skk_context_get_preedit(skk->context); 696 | char* off = fcitx_utf8_get_nth_char(preeditString, offset); 697 | if (offset > 0) { 698 | char* left = strndup(preeditString, off - preeditString); 699 | FcitxMessagesAddMessageAtLast(preedit, MSG_OTHER, "%s", left); 700 | fcitx_utils_free(left); 701 | } 702 | char* right = fcitx_utf8_get_nth_char(off, nchars); 703 | char* middle = strndup(off, right - off); 704 | FcitxMessagesAddMessageAtLast(preedit, MSG_HIGHLIGHT, "%s", middle); 705 | fcitx_utils_free(middle); 706 | 707 | if (*right != 0) { 708 | FcitxMessagesAddMessageAtLast(preedit, MSG_OTHER, "%s", right); 709 | } 710 | } 711 | else { 712 | FcitxMessagesAddMessageAtLast(preedit, MSG_OTHER, "%s", preeditString); 713 | } 714 | } 715 | 716 | FcitxInputStateSetClientCursorPos(input, len); 717 | skk->updatePreedit = false; 718 | 719 | return IRV_DISPLAY_CANDWORDS; 720 | } 721 | 722 | static void 723 | FcitxSkkReset(void *arg) 724 | { 725 | FcitxSkk *skk = (FcitxSkk*)arg; 726 | skk_context_reset(skk->context); 727 | } 728 | 729 | static void FcitxSkkReloadConfig(void* arg) 730 | { 731 | FcitxSkk *skk = (FcitxSkk*)arg; 732 | SkkLoadConfig(&skk->config); 733 | FcitxSkkApplyConfig(skk); 734 | FcitxSkkLoadRule(skk); 735 | FcitxSkkLoadDictionary(skk); 736 | } 737 | 738 | void FcitxSkkApplyConfig(FcitxSkk* skk) 739 | { 740 | SkkCandidateList* skkCandidates = skk_context_get_candidates(skk->context); 741 | skk_candidate_list_set_page_start(skkCandidates, skk->config.nTriggersToShowCandWin); 742 | skk_candidate_list_set_page_size(skkCandidates, skk->config.pageSize); 743 | skk_context_set_period_style(skk->context, skk->config.punctuationStyle); 744 | skk_context_set_egg_like_newline(skk->context, skk->config.eggLikeNewLine); 745 | } 746 | -------------------------------------------------------------------------------- /src/skk.conf.in: -------------------------------------------------------------------------------- 1 | [InputMethod] 2 | UniqueName=skk 3 | _Name=Skk 4 | IconName=skk 5 | Priority=1 6 | LangCode=ja 7 | Parent=fcitx-skk 8 | -------------------------------------------------------------------------------- /src/skk.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2012~2013 by Yichao Yu * 3 | * yyc1992@gmail.com * 4 | * Copyright (C) 2012~2013 by Weng Xuetian * 5 | * wengxt@gmail.com * 6 | * * 7 | * This program is free software; you can redistribute it and/or modify * 8 | * it under the terms of the GNU General Public License as published by * 9 | * the Free Software Foundation; either version 2 of the License, or * 10 | * (at your option) any later version. * 11 | * * 12 | * This program is distributed in the hope that it will be useful, * 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 15 | * GNU General Public License for more details. * 16 | * * 17 | * You should have received a copy of the GNU General Public License * 18 | * along with this program; if not, write to the * 19 | * Free Software Foundation, Inc., * 20 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * 21 | ***************************************************************************/ 22 | 23 | #ifndef __FCITX_SKK_H 24 | #define __FCITX_SKK_H 25 | 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | 33 | #define _(x) dgettext("fcitx-skk", x) 34 | #define N_(x) (x) 35 | 36 | #define ABCD_STR_CHOOSE "abcdefghij" 37 | #define ASDF_STR_CHOOSE "asdfghjkl;" 38 | 39 | typedef enum _FcitxSkkChooseKeyType { 40 | ChooseDigit, 41 | ChooseABCD, 42 | ChooseASDF 43 | } FcitxSkkChooseKeyType; 44 | 45 | typedef struct _FcitxSkkConfig { 46 | FcitxGenericConfig gconfig; 47 | SkkPeriodStyle punctuationStyle; 48 | SkkInputMode initialInputMode; 49 | FcitxCandidateLayoutHint candidateLayout; 50 | int nTriggersToShowCandWin; 51 | int pageSize; 52 | boolean showAnnotation; 53 | boolean eggLikeNewLine; 54 | FcitxSkkChooseKeyType candidateChooseKey; 55 | } FcitxSkkConfig; 56 | 57 | typedef struct { 58 | FcitxInstance *owner; 59 | SkkContext *context; 60 | boolean selected; 61 | boolean updatePreedit; 62 | boolean update_candidate; 63 | FcitxSkkConfig config; 64 | FcitxUIMenu inputModeMenu; 65 | gulong handler; 66 | gulong candidate_selected_handler; 67 | gulong candidate_populated_handler; 68 | gulong notify_preedit_handler; 69 | gulong retrieve_surrounding_text_handler; 70 | gulong delete_surrounding_text_handler; 71 | } FcitxSkk; 72 | 73 | CONFIG_BINDING_DECLARE(FcitxSkkConfig); 74 | 75 | #endif 76 | --------------------------------------------------------------------------------